2 ms·
ncurses/terminfo is pretty fundamentally broken for the modern SSH/Tmux use-case. For example a few years ago I tried to enable 24-bit ("truecolor") support...
by AceJohnny2 5y ago
ncurses/terminfo is pretty fundamentally broken for the modern SSH/Tmux use-case.
For example a few years ago I tried to enable 24-bit ("truecolor") support...
For one thing, the terminfo reporting for 24-bit color support wasn't universally recognized: terminfo added an 'RGB' capability to report this, but because this was added only "recently" (as far as terminals are concerned), not all programs relied on it. For example, Emacs or Vim didn't seem to use this capability.
For another thing, there can be a mismatch between what the local and remote terminfo databases (provided by ncurses) support in terms of recognized capabilities. I had tried to copy the xterm-direct terminfo to the remote, but it wasn't recognized! Turned out it had to be compiled with the remote server's tic.
Supposedly the Terminals Working Group [1] was looking into overhauling the ancient terminfo system to support this, but there was no clear path forward. I suppose one of the problems is the massive backwards-compatibility requirement. (There is probably nothing else in the software ecosystem that requires such backwards compatibility as terminals, they literally trace their ancestry to the 19th century! [2] )
[1] https://gitlab.freedesktop.org/terminal-wg https://gitlab.freedesktop.org/terminal-wg
[2] https://en.wikipedia.org/wiki/Teleprinter https://en.wikipedia.org/wiki/Teleprinter
- AceJohnny2 5y agoI should add that TermInfo databases, still present in Linux & macOS system today, are really interesting to compare with modern configuration systems. Nowadays we have no problem using verbose formats like TOML, JSON, YAML, or XML (plists!), because our computers are fast, have lots of storage and memory! We've traded efficiency for convenience. Terminfo is a remnant from when computers were slow and disk/memory constrained, and it made every byte count. It was hard to efficiently encode a database of all the capabilities of the terminals at the time! The trade was in favor of efficiency at the expense of convenience. Look up the manpage for tic, toe, infocmp & family.