Plots Scatter plot outside of the output
jcubic opened this issue · 2 comments
Check the conversation in jcubic/jquery.terminal#553 copy of the thread in xtermjs/xterm.js#2656
the problem is that scatter plot is broken because your code assume that if you move cursor to next line with \x1b[?B
it move max to next line. which is not correct on clear terminal. B ANSI escape code can't move past last line. It will stay at the last line no matter how big the argument is.
To reproduce the issue, open your demo with just scatter plot on clear terminal.
This is how it look like
it's only by accident that the plot works when there is more lines. In my processing of ANSI escapes it works if I use:
case 'B': // Down
//cursor.y += value;
cursor.y = Math.min(cursor.y + value, result.length);
break;
but this is not how terminal should work because it break other code. The proper is cursor.y += value
and the plot look like the image above.
Forget to mention that the plot is working correctly but only there is something in terminal emulator (so it show scrollbar) on clear terminal it's broken. The same issue is with xterm.js.
The Issue seems to be fixed. Thanks.