-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
this.buffer.lines.get(i) returns undefined #824
Comments
Hi @Tyriar I can reproduce it in the demo using the following after refreshing the demo page:
If you now call term.resize() with a rows value > the current rows it'll throw a type error if the terminal has had the chance to render in the meantime so try the resize() as a new command.
The key to reproducing it seems to be to get (Terminal.buffer.y === Terminal.buffer.scrollTop) &&((Terminal.buffer.y + Terminal.buffer.ybase) > 0) then calling reverseIndex. We managed to do that by using a scroll region but I don't know if that's the only way it can happen. The code as it is at the moment assumes a RI will only need to insert a new line when buffer.y === 0. Does that make sense? |
I confirm that this is happening on SourceLair as well. Here is a public Sentry event: https://sentry.io/share/issue/35323433302e333139343137383232/ |
Tracked this down to a problem with the 'buffer' property here. Seems now with the latest version of xterm.js, this keeps whatever buffer value was set to it initially or on activate. As I resize the terminal, I can see the buffers in the bufferset get updated, but it doesn't seem to get reflected in this property. Changing this property to be implemented through a getter resolves the resizing issue for me but now I get a problem with selecting content to be copied from the terminal. In any case, this is the diff I have so far.
|
The getter is definitely something we want, not sure what you mean by "problem with selecting content to be copied from the terminal" |
I mean when you are selecting content inside of the terminal to copy, like say the diff above from |
@anandsiddharth same underlying caused as #1932 |
Original issue: #821
PR for quick fix: #823
@jpmasters any more details on how you're using xterm.js?
The text was updated successfully, but these errors were encountered: