=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.78 retrieving revision 1.79 diff -c -r1.78 -r1.79 *** src/usr.bin/tmux/tty.c 2009/12/04 11:01:29 1.78 --- src/usr.bin/tmux/tty.c 2009/12/14 21:33:38 1.79 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.78 2009/12/04 11:01:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.79 2009/12/14 21:33:38 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1231,1236 **** --- 1231,1237 ---- if (fg == tc->fg && bg == tc->bg && ((flags ^ tc->flags) & (GRID_FLAG_FG256|GRID_FLAG_BG256)) == 0) return; + log_debug("fg was %hhu, now %hhu", tc->fg, fg); /* * Is either the default colour? This is handled specially because the *************** *** 1292,1297 **** --- 1293,1299 ---- { struct grid_cell *tc = &tty->cell; u_char fg = gc->fg; + char s[32]; /* Is this a 256-colour colour? */ if (gc->flags & GRID_FLAG_FG256) { *************** *** 1310,1315 **** --- 1312,1329 ---- tty_reset(tty); /* turn off bold */ } + /* Is this an aixterm bright colour? */ + if (fg >= 90 && fg <= 97) { + /* 16 colour terminals or above only. */ + if (tty_term_number(tty->term, TTYC_COLORS) >= 16) { + xsnprintf(s, sizeof s, "\033[%dm", fg); + tty_puts(tty, s); + goto save_fg; + } + fg -= 90; + (*attr) |= GRID_ATTR_BRIGHT; + } + /* Otherwise set the foreground colour. */ tty_putcode1(tty, TTYC_SETAF, fg); *************** *** 1325,1330 **** --- 1339,1345 ---- { struct grid_cell *tc = &tty->cell; u_char bg = gc->bg; + char s[32]; /* Is this a 256-colour colour? */ if (gc->flags & GRID_FLAG_BG256) { *************** *** 1341,1346 **** --- 1356,1373 ---- bg = colour_256to16(bg); if (bg & 8) bg &= 7; + } + + /* Is this an aixterm bright colour? */ + if (bg >= 100 && bg <= 107) { + /* 16 colour terminals or above only. */ + if (tty_term_number(tty->term, TTYC_COLORS) >= 16) { + xsnprintf(s, sizeof s, "\033[%dm", bg); + tty_puts(tty, s); + goto save_bg; + } + bg -= 100; + /* no such thing as a bold background */ } /* Otherwise set the background colour. */