mirror of
https://github.com/tmux/tmux.git
synced 2025-09-05 16:27:03 +00:00
aixterm colours can be used if -2 is given, as well as if TERM tells us
the terminal has >=16 colours.
This commit is contained in:
16
tty.c
16
tty.c
@ -1625,13 +1625,17 @@ tty_check_fg(struct tty *tty, const struct window_pane *wp,
|
|||||||
} else
|
} else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* How many colours does this terminal have? */
|
||||||
|
if ((tty->term->flags|tty->term_flags) & TERM_256COLOURS)
|
||||||
|
colours = 256;
|
||||||
|
else
|
||||||
colours = tty_term_number(tty->term, TTYC_COLORS);
|
colours = tty_term_number(tty->term, TTYC_COLORS);
|
||||||
|
|
||||||
/* Is this a 256-colour colour? */
|
/* Is this a 256-colour colour? */
|
||||||
if (gc->fg & COLOUR_FLAG_256) {
|
if (gc->fg & COLOUR_FLAG_256) {
|
||||||
/* And not a 256 colour mode? */
|
/* And not a 256 colour mode? */
|
||||||
if (!(tty->term->flags & TERM_256COLOURS) &&
|
if (colours != 256) {
|
||||||
!(tty->term_flags & TERM_256COLOURS)) {
|
|
||||||
gc->fg = colour_256to16(gc->fg);
|
gc->fg = colour_256to16(gc->fg);
|
||||||
if (gc->fg & 8) {
|
if (gc->fg & 8) {
|
||||||
gc->fg &= 7;
|
gc->fg &= 7;
|
||||||
@ -1674,6 +1678,11 @@ tty_check_bg(struct tty *tty, const struct window_pane *wp,
|
|||||||
} else
|
} else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* How many colours does this terminal have? */
|
||||||
|
if ((tty->term->flags|tty->term_flags) & TERM_256COLOURS)
|
||||||
|
colours = 256;
|
||||||
|
else
|
||||||
colours = tty_term_number(tty->term, TTYC_COLORS);
|
colours = tty_term_number(tty->term, TTYC_COLORS);
|
||||||
|
|
||||||
/* Is this a 256-colour colour? */
|
/* Is this a 256-colour colour? */
|
||||||
@ -1683,8 +1692,7 @@ tty_check_bg(struct tty *tty, const struct window_pane *wp,
|
|||||||
* palette. Bold background doesn't exist portably, so just
|
* palette. Bold background doesn't exist portably, so just
|
||||||
* discard the bold bit if set.
|
* discard the bold bit if set.
|
||||||
*/
|
*/
|
||||||
if (!(tty->term->flags & TERM_256COLOURS) &&
|
if (colours != 256) {
|
||||||
!(tty->term_flags & TERM_256COLOURS)) {
|
|
||||||
gc->bg = colour_256to16(gc->bg);
|
gc->bg = colour_256to16(gc->bg);
|
||||||
if (gc->bg & 8) {
|
if (gc->bg & 8) {
|
||||||
gc->bg &= 7;
|
gc->bg &= 7;
|
||||||
|
Reference in New Issue
Block a user