If you have a search and your buffer is already at the scrollback limit (so that older lines are dropped), any multi-line term.write() and any term.writeln() ending in \n causes the march decorations to fall out of sync with the buffer and mark the wrong lines.
Video:
Repro sandbox: https://codesandbox.io/p/sandbox/xtermjs-demo-forked-2jpjsz
It looks like every multi-line .write() will cause this bug, and only the .writeln() that ends with new lines.
In the sandbox I provided a bunch of example combinations where it breaks or doesn't.
This only works when the buffer is already at the scrollback limit, so I changed the options to have 0 scrollback to facilitate testing.
If you have a search and your buffer is already at the scrollback limit (so that older lines are dropped), any multi-line
term.write()
and anyterm.writeln()
ending in\n
causes the march decorations to fall out of sync with the buffer and mark the wrong lines.Video:
https://github.com/xtermjs/xterm.js/assets/1808295/2eee11b3-6b75-4002-bb67-0ae2b68ae078
Details
Versions:
Repro sandbox: https://codesandbox.io/p/sandbox/xtermjs-demo-forked-2jpjsz It looks like every multi-line
.write()
will cause this bug, and only the.writeln()
that ends with new lines.In the sandbox I provided a bunch of example combinations where it breaks or doesn't.
This only works when the buffer is already at the scrollback limit, so I changed the options to have 0 scrollback to facilitate testing.