xtermjs / xtermjs.org

The website for xterm.js
https://xtermjs.org
MIT License
28 stars 33 forks source link

Insert lines at the top #217

Closed Thoumar closed 1 month ago

Thoumar commented 1 month ago

Hi!

I'm using xterm.js in a React app and would like to implement the following behavior:

I've attempted this by manipulating the buffer with the following approach:

  1. Copy the current buffer lines.
  2. Create a new array of lines.
  3. Append the new lines to the terminal.

However, this feels more like a workaround, and I'm having difficulty achieving a smooth experience, for example when the lines are added the selection is resetting. Is there a better or recommended way to handle this ?