aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2018-05-07 17:02:31 +0100
committerThomas Adam <thomas@xteddy.org>2018-05-07 17:02:31 +0100
commitb2a2c3a1e90756313b6709905f189934123f85ed (patch)
treeaa7bc8515891c6250f37b2bdb7097e29871e0e30
parent91b220525b0406763dafb6698d2741bec580bc10 (diff)
parentf915a4bf0c035968b07d5660760cf7f6503b016c (diff)
downloadrtmux-b2a2c3a1e90756313b6709905f189934123f85ed.tar.gz
rtmux-b2a2c3a1e90756313b6709905f189934123f85ed.tar.bz2
rtmux-b2a2c3a1e90756313b6709905f189934123f85ed.zip
Merge branch 'obsd-master'
-rw-r--r--tty-term.c5
-rw-r--r--tty.c6
2 files changed, 5 insertions, 6 deletions
diff --git a/tty-term.c b/tty-term.c
index 9f0cac56..f81c93c0 100644
--- a/tty-term.c
+++ b/tty-term.c
@@ -494,8 +494,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;
/*
diff --git a/tty.c b/tty.c
index a006fb27..e8ab4714 100644
--- a/tty.c
+++ b/tty.c
@@ -2000,8 +2000,7 @@ tty_colours_fg(struct tty *tty, const struct grid_cell *gc)
char s[32];
/* Is this a 24-bit or 256-colour colour? */
- if (gc->fg & COLOUR_FLAG_RGB ||
- gc->fg & COLOUR_FLAG_256) {
+ if (gc->fg & COLOUR_FLAG_RGB || gc->fg & COLOUR_FLAG_256) {
if (tty_try_colour(tty, gc->fg, "38") == 0)
goto save_fg;
/* Should not get here, already converted in tty_check_fg. */
@@ -2030,8 +2029,7 @@ tty_colours_bg(struct tty *tty, const struct grid_cell *gc)
char s[32];
/* Is this a 24-bit or 256-colour colour? */
- if (gc->bg & COLOUR_FLAG_RGB ||
- gc->bg & COLOUR_FLAG_256) {
+ if (gc->bg & COLOUR_FLAG_RGB || gc->bg & COLOUR_FLAG_256) {
if (tty_try_colour(tty, gc->bg, "48") == 0)
goto save_bg;
/* Should not get here, already converted in tty_check_bg. */