diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-10-23 15:52:55 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-10-23 15:52:55 +0000 |
commit | 729967052b7e960e0ce4a74b269986c1ecbbf97e (patch) | |
tree | 272f846f97bd4ed853ee5ad43abc4f441e4dbe83 /usr.bin | |
parent | 13036ac53728366f6d296f3dd11e810f1435b46e (diff) |
Use tty_term_flag not _has for XT, and make -2 force direct use of
256-colour escape sequences (so setaf/setab can be bypassed if needed).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/tty.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 37226f874d1..db27a0447fd 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.188 2015/09/25 23:30:12 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.189 2015/10/23 15:52:54 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -228,7 +228,7 @@ tty_start_tty(struct tty *tty) if (tty_term_has(tty->term, TTYC_KMOUS)) tty_puts(tty, "\033[?1000l\033[?1002l\033[?1006l\033[?1005l"); - if (tty_term_has(tty->term, TTYC_XT)) { + if (tty_term_flag(tty->term, TTYC_XT)) { if (options_get_number(&global_options, "focus-events")) { tty->flags |= TTY_FOCUS; tty_puts(tty, "\033[?1004h"); @@ -293,7 +293,7 @@ tty_stop_tty(struct tty *tty) if (tty_term_has(tty->term, TTYC_KMOUS)) tty_raw(tty, "\033[?1000l\033[?1002l\033[?1006l\033[?1005l"); - if (tty_term_has(tty->term, TTYC_XT)) { + if (tty_term_flag(tty->term, TTYC_XT)) { if (tty->flags & TTY_FOCUS) { tty->flags &= ~TTY_FOCUS; tty_raw(tty, "\033[?1004l"); @@ -1648,6 +1648,13 @@ tty_try_256(struct tty *tty, u_char colour, const char *type) char s[32]; /* + * If the user has specified -2 to the client, setaf and setab may not + * work (or they may not want to use them), so send the usual sequence. + */ + if (tty->term_flags & TERM_256COLOURS) + goto fallback; + + /* * If the terminfo entry has 256 colours and setaf and setab exist, * assume that they work correctly. */ @@ -1664,13 +1671,6 @@ tty_try_256(struct tty *tty, u_char colour, const char *type) return (0); } - /* - * If the user has specified -2 to the client, setaf and setab may not - * work, so send the usual sequence. - */ - if (tty->term_flags & TERM_256COLOURS) - goto fallback; - return (-1); fallback: |