summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2013-03-27 11:17:13 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2013-03-27 11:17:13 +0000
commitfb6afaf70de1f42b84837d8a4a21ffe37e7a961e (patch)
treee8795d95b24e746c077403557f35eac5a7f6c358 /usr.bin
parente31b34f5af1b570ab657a8fc1a660ef97580732d (diff)
Remove tmux's (already minimal) 88 colour support. Such terminals are
few and unnecessary.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/colour.c28
-rw-r--r--usr.bin/tmux/options-table.c4
-rw-r--r--usr.bin/tmux/server-client.c4
-rw-r--r--usr.bin/tmux/tmux.18
-rw-r--r--usr.bin/tmux/tmux.c9
-rw-r--r--usr.bin/tmux/tmux.h8
-rw-r--r--usr.bin/tmux/tty-term.c6
-rw-r--r--usr.bin/tmux/tty.c34
8 files changed, 18 insertions, 83 deletions
diff --git a/usr.bin/tmux/colour.c b/usr.bin/tmux/colour.c
index b2d934b829f..60ec2db641f 100644
--- a/usr.bin/tmux/colour.c
+++ b/usr.bin/tmux/colour.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: colour.c,v 1.5 2012/01/21 08:23:12 nicm Exp $ */
+/* $OpenBSD: colour.c,v 1.6 2013/03/27 11:17:12 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -287,29 +287,3 @@ colour_256to16(u_char c)
return (table[c]);
}
-
-/* Convert 256 colour palette to 88. */
-u_char
-colour_256to88(u_char c)
-{
- static const u_char table[256] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 17, 18, 18, 19, 20, 21, 21, 22, 22, 23, 20, 21, 21, 22,
- 22, 23, 24, 25, 25, 26, 26, 27, 24, 25, 25, 26, 26, 27, 28, 29,
- 29, 30, 30, 31, 32, 33, 33, 34, 34, 35, 36, 37, 37, 38, 38, 39,
- 36, 37, 37, 38, 38, 39, 40, 41, 41, 42, 42, 43, 40, 41, 41, 42,
- 42, 43, 44, 45, 45, 46, 46, 47, 32, 33, 33, 34, 34, 35, 36, 37,
- 37, 38, 38, 39, 36, 37, 37, 38, 38, 39, 40, 41, 41, 42, 42, 43,
- 40, 41, 41, 42, 42, 43, 44, 45, 45, 46, 46, 47, 48, 49, 49, 50,
- 50, 51, 52, 53, 53, 54, 54, 55, 52, 53, 53, 54, 54, 55, 56, 57,
- 57, 58, 58, 59, 56, 57, 57, 58, 58, 59, 60, 61, 61, 62, 62, 63,
- 48, 49, 49, 50, 50, 51, 52, 53, 53, 54, 54, 55, 52, 53, 53, 54,
- 54, 55, 56, 57, 57, 58, 58, 59, 56, 57, 57, 58, 58, 59, 60, 61,
- 61, 62, 62, 63, 64, 65, 65, 66, 66, 67, 68, 69, 69, 70, 70, 71,
- 68, 69, 69, 70, 70, 71, 72, 73, 73, 74, 74, 75, 72, 73, 73, 74,
- 74, 75, 76, 77, 77, 78, 78, 79, 0, 0, 80, 80, 80, 81, 81, 81,
- 82, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87
- };
-
- return (table[c]);
-}
diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c
index 67199660019..b53aca8d3f3 100644
--- a/usr.bin/tmux/options-table.c
+++ b/usr.bin/tmux/options-table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options-table.c,v 1.35 2013/03/25 15:59:57 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.36 2013/03/27 11:17:12 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -414,7 +414,7 @@ const struct options_table_entry session_options_table[] = {
{ .name = "terminal-overrides",
.type = OPTIONS_TABLE_STRING,
- .default_str = "*88col*:colors=88,*256col*:colors=256"
+ .default_str = "*256col*:colors=256"
",xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007"
":Cc=\\E]12;%p1%s\\007:Cr=\\E]112\\007"
":Cs=\\E[%p1%d q:Csr=\\E[2 q,screen*:XT"
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 924e0a2ee3b..32907f3cb0d 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.98 2013/03/25 11:53:54 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.99 2013/03/27 11:17:12 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -981,8 +981,6 @@ server_client_msg_identify(
c->tty.flags |= TTY_UTF8;
if (data->flags & IDENTIFY_256COLOURS)
c->tty.term_flags |= TERM_256COLOURS;
- else if (data->flags & IDENTIFY_88COLOURS)
- c->tty.term_flags |= TERM_88COLOURS;
tty_resize(&c->tty);
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 97958ce81b0..cf6dd8c96ad 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.353 2013/03/25 15:59:57 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.354 2013/03/27 11:17:12 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: March 25 2013 $
+.Dd $Mdocdate: March 27 2013 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -98,10 +98,6 @@ The options are as follows:
Force
.Nm
to assume the terminal supports 256 colours.
-.It Fl 8
-Like
-.Fl 2 ,
-but indicates that the terminal supports 88 colours.
.It Fl C
Start in control mode.
Given twice
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index 5f2ab2bdb81..0a908d083f0 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.116 2013/03/25 10:11:45 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.117 2013/03/27 11:17:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -244,15 +244,10 @@ main(int argc, char **argv)
quiet = flags = 0;
label = path = NULL;
login_shell = (**argv == '-');
- while ((opt = getopt(argc, argv, "28c:Cdf:lL:qS:uUv")) != -1) {
+ while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUv")) != -1) {
switch (opt) {
case '2':
flags |= IDENTIFY_256COLOURS;
- flags &= ~IDENTIFY_88COLOURS;
- break;
- case '8':
- flags |= IDENTIFY_88COLOURS;
- flags &= ~IDENTIFY_256COLOURS;
break;
case 'c':
free(shell_cmd);
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 8358e5c76a4..d3c2d2ecc26 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.406 2013/03/25 11:44:00 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.407 2013/03/27 11:17:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -481,7 +481,7 @@ struct msg_identify_data {
#define IDENTIFY_UTF8 0x1
#define IDENTIFY_256COLOURS 0x2
-#define IDENTIFY_88COLOURS 0x4
+/* 0x4 unused */
#define IDENTIFY_CONTROL 0x8
#define IDENTIFY_TERMIOS 0x10
int flags;
@@ -1141,8 +1141,7 @@ struct tty_term {
struct tty_code codes[NTTYCODE];
#define TERM_256COLOURS 0x1
-#define TERM_88COLOURS 0x2
-#define TERM_EARLYWRAP 0x4
+#define TERM_EARLYWRAP 0x2
int flags;
LIST_ENTRY(tty_term) entry;
@@ -1986,7 +1985,6 @@ void colour_set_bg(struct grid_cell *, int);
const char *colour_tostring(int);
int colour_fromstring(const char *);
u_char colour_256to16(u_char);
-u_char colour_256to88(u_char);
/* attributes.c */
const char *attributes_tostring(u_char);
diff --git a/usr.bin/tmux/tty-term.c b/usr.bin/tmux/tty-term.c
index 69735814ef6..31fbb375b42 100644
--- a/usr.bin/tmux/tty-term.c
+++ b/usr.bin/tmux/tty-term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-term.c,v 1.30 2013/01/15 23:18:55 nicm Exp $ */
+/* $OpenBSD: tty-term.c,v 1.31 2013/03/27 11:17:12 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -404,11 +404,9 @@ tty_term_find(char *name, int fd, const char *overrides, char **cause)
goto error;
}
- /* Figure out if we have 256 or 88 colours. */
+ /* Figure out if we have 256. */
if (tty_term_number(term, TTYC_COLORS) == 256)
term->flags |= TERM_256COLOURS;
- if (tty_term_number(term, TTYC_COLORS) == 88)
- term->flags |= TERM_88COLOURS;
/*
* Terminals without xenl (eat newline glitch) wrap at at $COLUMNS - 1
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)
{