jupyter/terminado

Strange underlining with TERM=xterm and emacs

robnagler opened this issue · 4 comments

Versions: terminado 0.8.1 and jupyter 1.0.0.

In radiasoft/jupyter.radiasoft.org#15 you'll see a screenshot of the issue. The terminal goes into underline mode when emacs starts, and stays in underline mode after exit. reset does clear the mode so I suspect the term init string.

The term init string itself seems right:

$ TERM=xterm tput init | od -c
0000000 033   [   !   p 033   [   ?   3   ;   4   l 033   [   4   l 033
0000020   >
0000021

However, TERM=xterm tput init does not put the terminal in underline mode.

You can clear the mode with the reset SGR:

$ printf '\e[m'

Therefore, it does appear that terminado/xterm.js is going into underline mode.

emacs, ncurses, etc. are all a couple of years old (Fedora 21) so I don't suspect them.

A workaround is to set TERM=ansi, which seems to avoid the issue, because there's no init for ansi.

What version of notebook are you using? This is likely to be a bug of xterm.js (which actually does the terminal emulation) rather than terminado (which passes the data through to it). Xterm.js is bundled in the notebook.

Thanks for the quick response! notebook 5.2.2. I also attached the full pip list.

I couldn't find a version in xterm.js, but the md5 is:

83343775b76ff1f25429f6b63ed5da3a  ./lib/python2.7/site-packages/notebook/static/components/xterm.js/dist/xterm.js

pip-list.txt

So the version of xterm we bundled was 2.9.2 - you can see it here:

https://github.com/jupyter/notebook/blob/5.2.2/bower.json#L27

That still appears to be the latest release, if you want to open an issue on xterm.js. I can't see a similar issue already there. It's possible that they'll tell you to come back here because terminado or Jupyter is setting something up wrong, but if that is the case, hopefully we can get a better idea what to fix.

Created xtermjs/xterm.js#1147. Thanks.