this.buffer.lines.get(i) returns undefined
See original GitHub issueOriginal issue: https://github.com/sourcelair/xterm.js/issues/821 PR for quick fix: https://github.com/sourcelair/xterm.js/pull/823
The resize rows section below is meant to handle this row resizing, if this is actually happening we should figure out the root cause.
this.buffer.lines.get(i)
should always return an array wheni < this.buffer.lines.length
which is guaranteed by line 1942.
@jpmasters any more details on how you’re using xterm.js?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Node.js Buffer is undefined inside of a Class - Stack Overflow
Inside of this.load you are not returning anything, which means the function will return undefined. You have two ways you can fix this:....
Read more >Buffer | Node.js v19.3.0 Documentation
In other words, buf[index] returns undefined when index is negative or greater or equal to buf.length , and buf[index] = value does not...
Read more >Buffer Protocol — Python 3.11.1 documentation
The reference is owned by the consumer and automatically decremented and set to NULL by PyBuffer_Release() . The field is the equivalent of...
Read more >eval() - JavaScript - MDN Web Docs - Mozilla
The eval() function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script.
Read more >Using Buffers in Node.js - DigitalOcean
A buffer is a space in memory (typically RAM) that stores binary data. ... You may have used buffers implicitly if you wrote...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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?