diff options
author | Thomas Adam <thomas@xteddy.org> | 2018-02-04 12:02:24 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2018-02-04 12:02:24 +0000 |
commit | 24abfb72eb090a431de07c114836d9464f0f03c1 (patch) | |
tree | fd2fe1ced5ac6a307307642742e39be0140674d4 /tty.c | |
parent | 4e4c5008792069b3c8b0562a2411583e89b04aed (diff) | |
parent | fe7a871a23ada0c71fb0886ef99a356c67bf5c0d (diff) | |
download | rtmux-24abfb72eb090a431de07c114836d9464f0f03c1.tar.gz rtmux-24abfb72eb090a431de07c114836d9464f0f03c1.tar.bz2 rtmux-24abfb72eb090a431de07c114836d9464f0f03c1.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -2051,11 +2051,15 @@ tty_try_colour(struct tty *tty, int colour, const char *type) if (colour & COLOUR_FLAG_256) { /* - * 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 the user has specified -2 to the client (meaning + * TERM_256COLOURS is set), setaf and setab may not work (or + * they may not want to use them), so send the usual sequence. + * + * Also if RGB is set, setaf and setab do not support the 256 + * colour palette so use the sequences directly there too. */ - if (tty->term_flags & TERM_256COLOURS) + if ((tty->term_flags & TERM_256COLOURS) || + tty_term_has(tty->term, TTYC_RGB)) goto fallback_256; /* @@ -2096,6 +2100,7 @@ tty_try_colour(struct tty *tty, int colour, const char *type) fallback_256: xsnprintf(s, sizeof s, "\033[%s;5;%dm", type, colour & 0xff); + log_debug("%s: 256 colour fallback: %s", tty->client->name, s); tty_puts(tty, s); return (0); } |