Downgrade $TERM warnings to a term-support flog#11290
Conversation
The chances that xterm-256color breaks anything are miniscule. In the features we use, there are basically no differences, especially when you consider that we decode keys independently. E.g. tmux-256color has differences, but they are either just taste questions (xterm's clear_screen will also clear scrollback), or they're just... not actually different? Terminfo will claim that it uses a different cursor_up and exit_attribute_mode, but it also understands the xterm ones, and it sends a different key_home, but we decode that even with TERM=xterm-256color. In some cases, terminfo is also just outright *wrong* and will claim something does not support italics when it does. So, since the differences are very likely to simply not matter, throwing a warning is more confusing than it is helpful.
for the default binding we use |
|
Cherry-picked to 4.0.2 as 76d2419 |
|
Here are the terminfo entries that have absolutely no difference compared to xterm-256color in the capabilities that we use: alacritty foot ghostty hterm-256color rio xterm-256color xterm-ghostty That's absolutely zero, not even useless swaps ( if you ignore the sequences we only use to remove them from input (e.g. for width calculations), add contour and mintty. And that's going by terminfo to begin with. If you discount keys (which we decode independently) and discount differences that aren't actually a difference in practice (i.e. the xterm sequence works or the feature isn't supported and it is ignored), you can add basically every single terminal in use, including tmux-256color, st-256color, rxvt-unicode-256color (but we do not currently decode those keys - I don't think anyone cares?). Even Eterm-256color (that's emacs' ansi-term) should be fine (it breaks due to things that don't have terminfo capabilities). |
The chances that xterm-256color breaks anything are miniscule.
In the features we use, there are basically no differences, especially when you consider that we decode keys independently.
E.g. tmux-256color has differences, but they are either just taste questions (xterm's clear_screen will also clear scrollback), or they're just... not actually different?
Terminfo will claim that it uses a different cursor_up and exit_attribute_mode, but it also understands the xterm ones, and it sends a different key_home,
but we decode that even with TERM=xterm-256color.
In some cases, terminfo is also just outright wrong and will claim something does not support italics when it does.
So, since the differences are very likely to simply not matter, throwing a warning is more confusing than it is helpful.
TODOs:
I would like to include this in 4.0.2 because we've already had #11277, and that happened for at least two people. Even tho that was arguably a configuration error, the upshot is if we had just treated ghostty as xterm-256color literally nothing would have broken because there is no useful difference between these two for us.
I would actually go a step further and abolish our terminfo use altogether, but for that I would have to quantify just how many differences we have in practice, and that's hard because you need to throw away all the useless and sometimes outright wrong information terminfo gives you (e.g. the "konsole" terminfo entry is not used and does not document konsole's behavior, so you need to ignore it. some sequences like "cursor_normal" are sometimes equivalent but have their parts swapped, so
infocmpwill tell you there's a difference but it doesn't matter. tmux will understand xterm's sequences, so will screen (for the most part - but which parts exactly?). key_backspace is sometimes delete and sometimes ctrl-h but differs between terminals using the same TERM and can be configured).So this is the next step.