xtermjs/xtermjs.org

Replaying history sometimes causes control characters to be printed

Closed this issue · 1 comments

Hi,

I am handling a use case where I need to allow user to reload/recreate a previously loaded xterm.js window. This use case has a server component that stores all the data that was written to current session's Terminal instance. When a user reconnects to the same session again (perhaps using a different tab / browser), a new Terminal gets created and the server starts streaming (over a websocket) stored data to the new terminal instance. This approach seemed to work fine but after trying multiple reloads like that, I can see some control characters that are being rendered on the Terminal. I have shown a sample below -

:0+r436f^[^[P0+r6b75^[^[P0+r6b64^[^[P0+r6b72^[^[P0+r6b6c^[^[P0+r2332^
[^[P0+r2334^[^[P0+r2569^[^[P0+r2a37^[^[P0+r6b31^[^[P0+r6b32^[^[P0+r6b33^[^[P0+r6b34^[^[P0
+r6b35^[^[P0+r6b36^[^[P0+r6b37^[^[P0+r6b38^[^[P0+r6b39^[^[P0+r6b3b^[^[P0+r4631^[^[P0+r4632
^[^[P0+r2531^[^[P0+r2638^[^[P0+r6b62^[^[P0+r6b49^[^[P0+r6b44^[^[P0+r6b68^[^[P0+r4037^[^[P
0+r6b50^[^[P0+r6b4e^[^[P0+r4b31^[^[P0+r4b33^[^[P0+r4b34^[^[P0+r4b35^[^[P0+r6b42^[^[P0+r436
f^[^[P0+r6b75^[^[P0+r6b64^[^[P0+r6b72^[^[P0+r6b6c^[^[P0+r2332^[^[P0+r2334^[^[P0+r2569^[^[
P0+r2a37^[^[P0+r6b31^[^[P0+r6b32^[^[P0+r6b33^[^[P0+r6b34^[^[P0+r6b35^[^[P0+r6b36^[^[P0+r6b
37^[^[P0+r6b38^[^[P0+r6b39^[^[P0+r6b3b^[^[P0+r4631^[^[P0+r4632^[^[P0+r2531^[^[P0+r2638^[^
[P0+r6b62^[^[P0+r6b49^[^[P0+r6b44^[^[P0+r6b68^[^[P0+r4037^[^[P0+r6b50^[^[P0+r6b4e^[^[P0+r4
b31^[^[P0+r4b33^[^[P0+r4b34^[^[P0+r4b35^[^[P0+r6b42^[^[P0+r436f^[^[P0+r6b75^[^[P0+r6b64^[
^[P0+r6b72^[^[P0+r6b6c^[^[P0+r2332^[^[P0+r2334^[^[P0+r2569^[^[P0+r2a37^[^[P0+r6b31^[^[P0+r
6b32^[^[P0+r6b33^[^[P0+r6b34^[^[P0+r6b35^[^[P0+r6b36^[^[P0+r6b37^[^[P0+r6b38^[^[P0+r6b39^[
^[P0+r6b3b^[^[P0+r4631^[^[P0+r4632^[^[P0+r2531^[^[P0+r2638^[^[P0+r6b62^[^[P0+r6b49^[^[P0+
r6b44^[^[P0+r6b68^[^[P0+r4037^[^[P0+r6b50^[^[P0+r6b4e^[^[P0+r4b31^[^[P0+r4b33^[^[P0+r4b34^
[^[P0+r4b35^[^[P0+r6b42^[^[P0+r436f^[^[P0+r6b75^[^[P0+r6b64^[^[P0+r6b72^[^[P0+r6b6c^[^[P0
+r2332^[^[P0+r2334^[^[P0+r2569^[^[P0+r2a37^[^[P0+r6b31^[^[P0+r6b32^[^[P0+r6b33^[^[P0+r6b34
^[^[P0+r6b35^[^[P0+r6b36^[^[P0+r6b37^[^[P0+r6b38^[^[P0+r6b39^[^[P0+r6b3b^[^[P0+r4631^[^[P
0+r4632^[^[P0+r2531^[^[P0+r2638^[^[P0+r6b62^[^[P0+r6b49^[^[P0+r6b44^[^[P0+r6b68^[^[P0+r403
7^[^[P0+r6b50^[^[P0+r6b4e^[^[P0+r4b31^[^[P0+r4b33^[^[P0+r4b34^[^[P0+r4b35^[^[P0+r6b42^[\

After I press enter , I see the following sequence - 2R0;276;0c

I have no idea about terminal sequences to be able to debug this issue. Any insights are highly appreciated. I am using an old version of xterm.js (3.0.0) because I am working on a legacy code.

I will move this issue to xterm.js.