aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2015-10-23 15:52:54 +0000
committernicm <nicm>2015-10-23 15:52:54 +0000
commit63a3fd3c0fa41fec6cbc15dbd2bf08ceb3ccb208 (patch)
tree26e2a529d60be0f7678a0b6f456946ac8a6eba46
parent3ebcf25149d75977ea97e9d4f786e0508d1a0d5e (diff)
downloadrtmux-63a3fd3c0fa41fec6cbc15dbd2bf08ceb3ccb208.tar.gz
rtmux-63a3fd3c0fa41fec6cbc15dbd2bf08ceb3ccb208.tar.bz2
rtmux-63a3fd3c0fa41fec6cbc15dbd2bf08ceb3ccb208.zip
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).
-rw-r--r--tty.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tty.c b/tty.c
index 7be952c8..5d23ee82 100644
--- a/tty.c
+++ b/tty.c
@@ -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: