If you take the following escape sequences and run them in a fast loop nothing is rendered in the end.
const lines = [
'\u001b\u0063',
'\u001b\u005d\u0030\u003b\u0020\u0007',
'\u001b\u005b\u0048\u001b\u005b\u0032\u004a\u001b\u005b\u0031\u003b\u0033\u0033\u006d',
'test test test',
'lalala',
];
for (let line of lines) {
this.terminal.write(line);
}
But if you make them run as a microtask it renders fine:
var inter;
inter = setInterval(
() => (lines.length ? this.terminal.write(lines.shift()) : clearInterval(inter)),
0
);
The same script that contains these escape codes is run daily with thousands of users and it displays fine using an older version of xterm.js.
@agronick Can repro it, seems RIS wrongly recreates the write buffers as well forgetting stuff behind.
Thanks for taking care of that so quick. You guys are awesome. Any idea when it will hit NPM?
Prolly with the next release around first week in June. Care to test if https://github.com/xtermjs/xterm.js/pull/2127 solves the issue for you? Because that code was not touched for 2 years, you either were on a really old version or its not the right fix yet. (at least works with the data you gave in the issue description)
I just got home for the long weekend and I won't have access until Tuesday. I'll be sure to test it then. It is possible we are on an old version.
It is also possible we have the issue in production but most servers don't output fast enough to cause the issue. Or that the users are seeing it but never reported it. Maybe they open and close the terminal until they get lucky and it works. I've never heard anyone mention it.
@jerch Good news! It definitely fixes it.
Most helpful comment
@jerch Good news! It definitely fixes it.