console doesn't support xterm-256color
's "Esc E" for newline
#14603
Labels
Needs-Tag-Fix
Doesn't match tag requirements
Needs-Triage
It's a new issue that the core contributor team needs to triage at the next triage meeting
When I try to use the control sequence
\EE
("Esc E") on a recent WSL,Whereas in native Linux terminals I've tried, and PuTTy, I get:
This has recently become a problem for me because it's listed as the sequence for a newline (
nel
) forxterm-256color
in recent versions of the ncurses terminfo database (follow the link toxterm-new
and thenxterm-p370
). It's also documented as an Xterm control sequence here.From browsing the changelog I think this was added in early 2021 and has recently made its way into Ubuntu - it's not there in Ubuntu 20.04 and is there in Ubuntu 22.04. One way to see if it's listed on a particular machine is to run
infocmp -x -1 xterm-256color | grep nel
.It goes wrong for me in practice with tools that use the Haskell terminfo library, which has this code to look up how to produce a newline. If
nel
isn't listed, then the fallback option works fine, but if it is listed then it tries to use\EE
as instructed. This means that tools like ghci (the Haskell REPL) do this:instead of the expected.
It can be reproduced without running a Linux shell by this
.cmd
file (rename to remove the.txt
after downloading). You can see other control sequences do work by changing theE
on the finalecho
line, for example changing it to anM
invokesri
(scroll backwards). Of course without the WSL angle there's no particular reason to expect a random xterm control sequence to work in console.Apologies if I've got completely the wrong end of the stick here about the problem, I didn't know anything much about how terminals actually communicate until I started digging into this problem. Now that I understand the issue better there should be various workarounds available (like setting
TERM
to something different).The text was updated successfully, but these errors were encountered: