diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-12-26 11:02:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-12-26 11:02:32 +0000 |
commit | a775107f5f346e66e92652fb2cbfabebe83de570 (patch) | |
tree | 00633a3570d838847252d381198254d8a1462e40 /tty.c | |
parent | cd9b1b1fd399479ed58feb51201c2bc1db55faa5 (diff) | |
download | rtmux-a775107f5f346e66e92652fb2cbfabebe83de570.tar.gz rtmux-a775107f5f346e66e92652fb2cbfabebe83de570.tar.bz2 rtmux-a775107f5f346e66e92652fb2cbfabebe83de570.zip |
Fix the logic so that transition from a 256 colour to default works properly.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1253,19 +1253,21 @@ tty_colours(struct tty *tty, const struct grid_cell *gc, u_char *attr) tty_reset(tty); else { if (fg_default && - fg != tc->fg && !(tc->flags & GRID_FLAG_FG256)) { + (tc->fg != 8 || tc->flags & GRID_FLAG_FG256)) { if (have_ax) tty_puts(tty, "\033[39m"); - else if (tc->fg != 7) + else if (tc->fg != 7 || + tc->flags & GRID_FLAG_FG256) tty_putcode1(tty, TTYC_SETAF, 7); tc->fg = 8; tc->flags &= ~GRID_FLAG_FG256; } if (bg_default && - bg != tc->bg && !(tc->flags & GRID_FLAG_BG256)) { + (tc->bg != 8 || tc->flags & GRID_FLAG_BG256)) { if (have_ax) tty_puts(tty, "\033[49m"); - else if (tc->bg != 0) + else if (tc->bg != 0 || + tc->flags & GRID_FLAG_BG256) tty_putcode1(tty, TTYC_SETAB, 0); tc->bg = 8; tc->flags &= ~GRID_FLAG_BG256; |