Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plots Scatter plot outside of the output #14

Closed
jcubic opened this issue Dec 30, 2019 · 2 comments
Closed

Plots Scatter plot outside of the output #14

jcubic opened this issue Dec 30, 2019 · 2 comments

Comments

@jcubic
Copy link
Contributor

jcubic commented Dec 30, 2019

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

ervy5

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.

@jcubic jcubic mentioned this issue Jan 1, 2020
@jcubic
Copy link
Contributor Author

jcubic commented Jan 1, 2020

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.

chunqiuyiyu pushed a commit that referenced this issue Jan 3, 2020
@jcubic
Copy link
Contributor Author

jcubic commented Jan 3, 2020

The Issue seems to be fixed. Thanks.

@jcubic jcubic closed this as completed Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant