diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-12-26 23:50:15 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-12-26 23:50:15 +0000 |
commit | 71e6b4d6177def759a70dabc54240d70509bc99f (patch) | |
tree | 0f0916d64db90394bce78641f940b3462ec86900 | |
parent | 51a284e056af08d765c9827db216e14b1c3aa2e9 (diff) | |
download | rtmux-71e6b4d6177def759a70dabc54240d70509bc99f.tar.gz rtmux-71e6b4d6177def759a70dabc54240d70509bc99f.tar.bz2 rtmux-71e6b4d6177def759a70dabc54240d70509bc99f.zip |
Sync OpenBSD patchset 594:
Fix the logic so that transition from a 256 colour to default works properly.
-rw-r--r-- | tty.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.184 2009-12-26 23:49:27 tcunha Exp $ */ +/* $Id: tty.c,v 1.185 2009-12-26 23:50:15 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1258,19 +1258,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; |