Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

undefined lines throwing errors #54

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

I was having trouble where the terminal was reporting a different line count then what actually existed. As a result, a exception was being thrown. This makes sure the line exists before trying to operate on it.

Owner

chjj commented Nov 8, 2012

Very strange. This seems like it would only be a bandaid fix. Can you reproduce this with raw writes to the terminal? e.g. term.write('foo\n\e[2Jbar')

Very busy right now, but I'll look at this more later.

I'll work on an example that I can show on jsfiddle. I'm also quite a bit busy today, but I should have something later tonight.

http://jsfiddle.net/walkingeyerobot/kxbqE/ - example using term.write that causes an exception to be thrown.

Owner

chjj commented Nov 19, 2012

Fantastic work. I'll have a look at this.

chjj added a commit that referenced this pull request Jan 6, 2013

Add potential fixes for #54.
This string will cause an error to be thrown when written:
^[[1;54r^[[H^[[11M^[[0;7m^O

It breaks down to these calls:
setScrollRegion([1, 54]);
cursorPos([1, 1]);
deleteLines([11]);
charAttributes([0, 7]);
setgLevel(0); // shift-in, 0x0f

^[[1;54r sets the scrollBottom to 54 which is bigger than the height of the
terminal (25 in the original issue). This may be due to a mismatch between what
the program thinks is the terminal height and what the terminal knows is its
height. In other words, it's the programs fault. We can add a failsafe for this
in multiple places.

Looks like a fix for this issue was put in, making my pull request no longer necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment