aboutsummaryrefslogtreecommitdiff
path: root/tty-term.c
diff options
context:
space:
mode:
authornicm <nicm>2018-05-07 13:39:09 +0000
committernicm <nicm>2018-05-07 13:39:09 +0000
commitf915a4bf0c035968b07d5660760cf7f6503b016c (patch)
tree5a7d166916463148775fc7fb4c4497cf223c701f /tty-term.c
parent988c6bc433afe23b3883a0be54b8efa9d7d744f6 (diff)
downloadrtmux-f915a4bf0c035968b07d5660760cf7f6503b016c.tar.gz
rtmux-f915a4bf0c035968b07d5660760cf7f6503b016c.tar.bz2
rtmux-f915a4bf0c035968b07d5660760cf7f6503b016c.zip
Handle terminfo colors > 256 correctly, GitHub issue 1337.
Diffstat (limited to 'tty-term.c')
-rw-r--r--tty-term.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tty-term.c b/tty-term.c
index b9afd96c..b7536487 100644
--- a/tty-term.c
+++ b/tty-term.c
@@ -488,8 +488,9 @@ tty_term_find(char *name, int fd, char **cause)
goto error;
}
- /* Figure out if we have 256. */
- if (tty_term_number(term, TTYC_COLORS) == 256)
+ /* Figure out if we have 256 colours (or more). */
+ if (tty_term_number(term, TTYC_COLORS) >= 256 ||
+ tty_term_has(term, TTYC_RGB))
term->flags |= TERM_256COLOURS;
/*