summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-12-26 11:02:32 +0000
committernicm <nicm@openbsd.org>2009-12-26 11:02:32 +0000
commit240d499889f3ca4bf39ee522106e910fcbc01797 (patch)
tree4feced6f259e98feca72643187a3ce4122db8b90 /usr.bin/tmux/tty.c
parentNuke some stray debugging. (diff)
downloadwireguard-openbsd-240d499889f3ca4bf39ee522106e910fcbc01797.tar.xz
wireguard-openbsd-240d499889f3ca4bf39ee522106e910fcbc01797.zip
Fix the logic so that transition from a 256 colour to default works properly.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index b210787b217..d4ca3ae6180 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.80 2009/12/26 10:39:02 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.81 2009/12/26 11:02:32 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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;