diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-04-25 21:02:43 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-04-25 21:02:43 +0100 |
commit | 7c4a2253e89dd26018de489301e46d8425893a78 (patch) | |
tree | 50a72e4f59f1d27092b9e1c29fb0d0a1228cfe62 /tty.c | |
parent | f2c0605d6d7051898318703142af4ceb7e3f845f (diff) | |
parent | 2d65bbd94129c4542394a83151cb1a131c3c7871 (diff) | |
download | rtmux-7c4a2253e89dd26018de489301e46d8425893a78.tar.gz rtmux-7c4a2253e89dd26018de489301e46d8425893a78.tar.bz2 rtmux-7c4a2253e89dd26018de489301e46d8425893a78.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -2388,7 +2388,11 @@ tty_colours_fg(struct tty *tty, const struct grid_cell *gc) /* Is this an aixterm bright colour? */ if (gc->fg >= 90 && gc->fg <= 97) { - tty_putcode1(tty, TTYC_SETAF, gc->fg - 90 + 8); + if (tty->term_flags & TERM_256COLOURS) { + xsnprintf(s, sizeof s, "\033[%dm", gc->fg); + tty_puts(tty, s); + } else + tty_putcode1(tty, TTYC_SETAF, gc->fg - 90 + 8); goto save_fg; } @@ -2416,7 +2420,11 @@ tty_colours_bg(struct tty *tty, const struct grid_cell *gc) /* Is this an aixterm bright colour? */ if (gc->bg >= 90 && gc->bg <= 97) { - tty_putcode1(tty, TTYC_SETAB, gc->bg - 90 + 8); + if (tty->term_flags & TERM_256COLOURS) { + xsnprintf(s, sizeof s, "\033[%dm", gc->bg + 10); + tty_puts(tty, s); + } else + tty_putcode1(tty, TTYC_SETAB, gc->bg - 90 + 8); goto save_bg; } |