|
|
|
|
|
by faho
1499 days ago
|
|
Plus a lot of interesting things aren't mentioned in terminfo - bracketed paste, cursor shaping, synchronized output, ... And even truecolor was added to it about 10 years after terminals started gaining support. And many terminals just claim to be "xterm-256color". >2) try them and have graceful degradation if they're not supported Note: There are many cases where degradation isn't graceful. Many terminals on windows currently spew garbage on your screen if you send bracketed paste (alacritty, for instance). >1) probe for those features by asking the terminal, which some terminals support This requires waiting for a reply, which often isn't useful. E.g. if you want synchronized output, you want it from the very first paint (because that's when the terminal is most likely to still be resized, e.g. by a tiling window manager). So you would have to delay your startup until you've either gotten a reply or "enough" time has passed that you believe it's not supported. Frankly, this is all a big mess and terminfo isn't very helpful, but we don't have a good alternative either. |
|