From f915a4bf0c035968b07d5660760cf7f6503b016c Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 7 May 2018 13:39:09 +0000 Subject: Handle terminfo colors > 256 correctly, GitHub issue 1337. --- tty-term.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tty-term.c') 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; /* -- cgit