aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-06-03 10:01:10 +0100
committerThomas Adam <thomas@xteddy.org>2017-06-03 10:01:10 +0100
commit80235d6fdd466b0aacaa5fa6c411bd6c38160aef (patch)
treed112d39c6a6bcd1b08d25e51ad4c1e5c592639ea
parent73b9328c1fcf659dd884b8574cf7fabf0557ccae (diff)
parent493a1846d070f647655bed663c1cb444ee132093 (diff)
downloadrtmux-80235d6fdd466b0aacaa5fa6c411bd6c38160aef.tar.gz
rtmux-80235d6fdd466b0aacaa5fa6c411bd6c38160aef.tar.bz2
rtmux-80235d6fdd466b0aacaa5fa6c411bd6c38160aef.zip
Merge branch 'obsd-master'
-rw-r--r--tty.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/tty.c b/tty.c
index 72453821..7759e0ea 100644
--- a/tty.c
+++ b/tty.c
@@ -1841,10 +1841,18 @@ tty_check_fg(struct tty *tty, const struct window_pane *wp,
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) {
@@ -1894,10 +1902,11 @@ tty_check_bg(struct tty *tty, const struct window_pane *wp,
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) {