mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Instead of having a default set of terminals in terminal-overrides that get XT
added and using that as a marker for xterm(1)-like, assume that if the terminfo(5) entry already has XT or the clear capability starts with CSI then the terminal is VT100-like and it should be safe to send DA requests. The DA responses trigger additional features being added. This is all to detect extensions if terminfo(5) is wrong or inadequate. If it fails, tmux will just fall back to using the capabilities in the terminfo(5) entry alone.
This commit is contained in:
22
tty-term.c
22
tty-term.c
@ -561,16 +561,30 @@ tty_term_create(struct tty *tty, char *name, int *feat, int fd, char **cause)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/*
|
||||
* If TERM has XT or clear starts with CSI then it is safe to assume
|
||||
* the terminal is derived from a VT100. This controls whether device
|
||||
* attributes requests are sent to get more information.
|
||||
*
|
||||
* This is a bit of a hack but there aren't that many alternatives.
|
||||
* Worst case tmux will just fall back to using whatever terminfo(5)
|
||||
* says without trying to correct anything that is missing.
|
||||
*
|
||||
* Also add few features that VT100-like terminals should either
|
||||
* support or safely ignore.
|
||||
*/
|
||||
s = tty_term_string(term, TTYC_CLEAR);
|
||||
if (tty_term_flag(term, TTYC_XT) || strncmp(s, "\033[", 2) == 0) {
|
||||
term->flags |= TERM_VT100LIKE;
|
||||
tty_add_features(feat, "bpaste,focus,title", ",");
|
||||
}
|
||||
|
||||
/* Add RGB feature if terminal has RGB colours. */
|
||||
if ((tty_term_flag(term, TTYC_TC) || tty_term_has(term, TTYC_RGB)) &&
|
||||
(!tty_term_has(term, TTYC_SETRGBF) ||
|
||||
!tty_term_has(term, TTYC_SETRGBB)))
|
||||
tty_add_features(feat, "RGB", ",");
|
||||
|
||||
/* Add some features if terminal has XT. */
|
||||
if (tty_term_flag(term, TTYC_XT))
|
||||
tty_add_features(feat, "bpaste,focus,title", ",");
|
||||
|
||||
/* Apply the features and overrides again. */
|
||||
tty_apply_features(term, *feat);
|
||||
tty_term_apply_overrides(term);
|
||||
|
Reference in New Issue
Block a user