diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-27 11:17:13 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-27 11:17:13 +0000 |
commit | fb6afaf70de1f42b84837d8a4a21ffe37e7a961e (patch) | |
tree | e8795d95b24e746c077403557f35eac5a7f6c358 /usr.bin/tmux/tty.c | |
parent | e31b34f5af1b570ab657a8fc1a660ef97580732d (diff) |
Remove tmux's (already minimal) 88 colour support. Such terminals are
few and unnecessary.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index c10818f6cc0..b50d55184d0 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.157 2013/03/24 09:29:00 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.158 2013/03/27 11:17:12 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -35,7 +35,6 @@ void tty_read_callback(struct bufferevent *, void *); void tty_error_callback(struct bufferevent *, short, void *); int tty_try_256(struct tty *, u_char, const char *); -int tty_try_88(struct tty *, u_char, const char *); void tty_colours(struct tty *, const struct grid_cell *); void tty_check_fg(struct tty *, struct grid_cell *); @@ -1446,9 +1445,7 @@ tty_check_fg(struct tty *tty, struct grid_cell *gc) /* Is this a 256-colour colour? */ if (gc->flags & GRID_FLAG_FG256) { /* And not a 256 colour mode? */ - if (!(tty->term->flags & TERM_88COLOURS) && - !(tty->term_flags & TERM_88COLOURS) && - !(tty->term->flags & TERM_256COLOURS) && + if (!(tty->term->flags & TERM_256COLOURS) && !(tty->term_flags & TERM_256COLOURS)) { gc->fg = colour_256to16(gc->fg); if (gc->fg & 8) { @@ -1481,9 +1478,7 @@ tty_check_bg(struct tty *tty, struct grid_cell *gc) * palette. Bold background doesn't exist portably, so just * discard the bold bit if set. */ - if (!(tty->term->flags & TERM_88COLOURS) && - !(tty->term_flags & TERM_88COLOURS) && - !(tty->term->flags & TERM_256COLOURS) && + if (!(tty->term->flags & TERM_256COLOURS) && !(tty->term_flags & TERM_256COLOURS)) { gc->bg = colour_256to16(gc->bg); if (gc->bg & 8) @@ -1511,11 +1506,9 @@ tty_colours_fg(struct tty *tty, const struct grid_cell *gc) /* Is this a 256-colour colour? */ if (gc->flags & GRID_FLAG_FG256) { - /* Try as 256 colours or translating to 88. */ + /* Try as 256 colours. */ if (tty_try_256(tty, fg, "38") == 0) goto save_fg; - if (tty_try_88(tty, fg, "38") == 0) - goto save_fg; /* Else already handled by tty_check_fg. */ return; } @@ -1546,11 +1539,9 @@ tty_colours_bg(struct tty *tty, const struct grid_cell *gc) /* Is this a 256-colour colour? */ if (gc->flags & GRID_FLAG_BG256) { - /* Try as 256 colours or translating to 88. */ + /* Try as 256 colours. */ if (tty_try_256(tty, bg, "48") == 0) goto save_bg; - if (tty_try_88(tty, bg, "48") == 0) - goto save_bg; /* Else already handled by tty_check_bg. */ return; } @@ -1591,21 +1582,6 @@ tty_try_256(struct tty *tty, u_char colour, const char *type) return (0); } -int -tty_try_88(struct tty *tty, u_char colour, const char *type) -{ - char s[32]; - - if (!(tty->term->flags & TERM_88COLOURS) && - !(tty->term_flags & TERM_88COLOURS)) - return (-1); - colour = colour_256to88(colour); - - xsnprintf(s, sizeof s, "\033[%s;5;%hhum", type, colour); - tty_puts(tty, s); - return (0); -} - void tty_bell(struct tty *tty) { |