-/* $OpenBSD: tty.c,v 1.287 2017/05/31 10:29:15 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.288 2017/06/03 07:15:23 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
u_int colours;
int c;
- /* Perform substitution if this pane has a palette */
- if ((~gc->flags & GRID_FLAG_NOPALETTE) &&
- (c = window_pane_get_palette(wp, gc->fg)) != -1)
- gc->fg = c;
+ /*
+ * Perform substitution if this pane has a palette. If the bright
+ * attribute is set, use the bright entry in the palette by changing to
+ * the aixterm colour.
+ */
+ if (~gc->flags & GRID_FLAG_NOPALETTE) {
+ c = gc->fg;
+ if (gc->fg < 8 && gc->attr & GRID_ATTR_BRIGHT)
+ c += 90;
+ if ((c = window_pane_get_palette(wp, c)) != -1)
+ gc->fg = c;
+ }
/* Is this a 24-bit colour? */
if (gc->fg & COLOUR_FLAG_RGB) {
u_int colours;
int c;
- /* Perform substitution if this pane has a palette */
- if ((~gc->flags & GRID_FLAG_NOPALETTE) &&
- (c = window_pane_get_palette(wp, gc->bg)) != -1)
- gc->bg = c;
+ /* Perform substitution if this pane has a palette. */
+ if (~gc->flags & GRID_FLAG_NOPALETTE) {
+ if ((c = window_pane_get_palette(wp, gc->bg)) != -1)
+ gc->bg = c;
+ }
/* Is this a 24-bit colour? */
if (gc->bg & COLOUR_FLAG_RGB) {