JupyterHub Terminal gets clobbered with ascii color codes (?)

I’m not sure whether ascii color codes is the right way to put it, but it looks like this:

[myuser@jupyterhub ~]$ 2R0;276;0c10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff12;2$y2R0;276;0c10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff12;2$y2R0;276;0c10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff12;2$y2R0;276;0c10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff12;2$y2R0;276;0c10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff12;2$y2R0;276;0c10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff12;2$y2R0;276;0c10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff12;2$y2R0;276;0c10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff12;2$y2R0;276;0c10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff12;2$y

and sometimes it looks like this:

[myuser@jupyterhub ~]$ 2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y2026;0$y2048;0$y

This happens at regular intervals, like every 30sec or so the clobber gets longer. It’s a bit annoying especially when using some terminal applications. I get unwanted key presses all the time you know.

I suspect this is an xterm.js bug that the developers have just decided to ignore (maybe they think they have already fixed it).

Any good advice or references? Is this solvable, or should I launch a new issue somewhere maybe?

P.S. I have only regular user privileges for the jupyterhub, but I know the admins so I can ask them to try something.

Are you using JupyterLab, Jupyter Notebook, or another interface? They’re responsible for the terminal component, JupyterHub launches one of those interfaces.

Are you the only user who has this problem, or does it affect everyone?

It affects everyone. I’m using JupyterLab. Haven’t tried on Notebook. Will do that right away and let you know.

Okay, no clobber so far on the Notebook interface! Nice! This solution is good enough for me, although it would be cool to know where this problem on the Lab interface is coming from. Thanks!

Edit: celebrated too soon, see message below.

Celebrated too soon. I get the clobber in the Notebook interface as well, although way more seldom. (Currently Lab interval ~30 seconds, Notebook interval ~15 minutes.)

I get that clobber only when letting the terminal open on my jupyterlab and closing the tab and returning next day. Never seen it pop up during an active session. Maybe some other kind of service running every 30 seconds is causing this?

Yes probably so, but it’s still a mystery what actually causes it. The frequency seems to depend on server activity (including my own activity: more terminal tabs open & active → more frequent clobber). Anyway, it happens during active sessions for everyone on the hub.

Messy code in the terminal after reopening JupyterLab · Issue #17179 · jupyterlab/jupyterlab · GitHub must be this one (edit: added a comment in there; see also the reply below)

See this linked xterm.js github discussion. I think the solution outline is in the reply by jerch. Sorry for jumping to the conclusion that it would be an xterm.js bug. :slight_smile: JupyterHub Terminal gets clobbered with ascii color codes · xtermjs/xterm.js · Discussion #6155 · GitHub