Check terminfo for ts capability to determine title setting support#10037
Conversation
92cb50e to
7d4eca2
Compare
This was stabilized in Rust 1.70.0, but CI uses 1.67.0 where this function was still marked unstable.
|
Are you seeing problems or is this for theoretical correctness? Unfortunately the terminfo system has pretty huge problems (most terminals claim to be "xterm" so it's usually ineffectual, and the ones that don't might have problems because the terminfo database doesn't have the entry). That means it's also just a heuristic and often other things might be more helpful. Depends on the case you're seeing, which is why I'm asking. |
It is a real problem for a new terminal emulator that I'm helping to test. It's not listed in the known list of terminals, so fish incorrectly assumes it's not capable of setting the title. This terminal does ship its own terminfo entry that contains the
Understood, but in this case I think it's low risk. If the check fails it falls back to the existing heuristics. So this only impacts terminals which ship a terminfo that contains the Another alternative would be to query support from the terminal itself using OSC 60, but I have no idea how widely that is implemented. |
Does this terminal have a name or is that not public knowledge?
Querying scares me. I don't like the idea of sending something and getting a response maybe, possibly, but later. How long do we wait? And I've seen terminals spew querying escapes, so I don't like it.
My "fear" is that something may pick a terminfo entry that does list ts, but doesn't actually support it. Maybe it's just a bug in that entry on that OS - the terminfo database is annoyingly sticky, especially on things like macOS (do they list italics for terminal.app yet?). Still, terminfo may be the least bad option. (tbh my favorite solution would be for all terminals to simply support this enough to be able to just ignore a title, so we could just set it unconditionally) |
It is called ghostty. It's currently in a closed beta testing period.
Yea I agree, I mentioned it as a possibility but it's not my preference in this case either.
We could reduce this risk further by only checking for So before falling back to checking the stdin TTY device name, check |
|
After further consideration I'm just gonna merge this as-is. It's not like the terminal title is some new obscure feature. It should be table stakes. Any good terminal standard would just enforce that the sequence is understood (sadly we do not live in a world with a good terminal standard). I'm still extremely sad at the state of current terminal cross-compatibility and that we're still relying on the broken and near useless terminfo. |
Terminal titles are set with an OSC 0 sequence. I don't think we want to support terminals that react badly to unknown OSC (or CSI) sequences. So let's remove our feature detection. This will fix future false negatives along the lines of fish-shell#10037
Terminal titles are set with an OSC 0 sequence. I don't think we want to support terminals that react badly to unknown OSC (or CSI) sequences. So let's remove our feature detection. This will fix future false negatives along the lines of fish-shell#10037
Terminal titles are set with an OSC 0 sequence. I don't think we want to support terminals that react badly to unknown OSC (or CSI) sequences. So let's remove our feature detection. This will fix future false negatives along the lines of fish-shell#10037
Terminal titles are set with an OSC 0 sequence. I don't think we want to support terminals that react badly to unknown OSC (or CSI) sequences. So let's remove our feature detection. This will fix future false negatives along the lines of fish-shell#10037
Terminal titles are set with an OSC 0 sequence. I don't think we want to support terminals that react badly to unknown OSC (or CSI) sequences. So let's remove our feature detection. This will fix future false negatives along the lines of fish-shell#10037
Terminal titles are set with an OSC 0 sequence. I don't think we want to support terminals that react badly to unknown OSC (or CSI) sequences. So let's remove our feature detection. This will fix future false negatives along the lines of fish-shell#10037
Terminal titles are set with an OSC 0 sequence. I don't think we want to support terminals that react badly to unknown OSC (or CSI) sequences. So let's remove our feature detection. This will fix future false negatives along the lines of #10037
Description
Check terminfo for the
tscapability to determine if a terminal supports setting the window title.TODOs: