summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty-keys.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-05-16 14:30:17 +0000
committernicm <nicm@openbsd.org>2020-05-16 14:30:17 +0000
commit8942cc580a7cb20b9705b783321c94cef701bf41 (patch)
treec6ab95b12319110073f489213577333df40890bb /usr.bin/tmux/tty-keys.c
parentBuild list of paths and weed out duplicates before loading configs, and (diff)
downloadwireguard-openbsd-8942cc580a7cb20b9705b783321c94cef701bf41.tar.xz
wireguard-openbsd-8942cc580a7cb20b9705b783321c94cef701bf41.zip
Move terminal features into a single file.
Diffstat (limited to 'usr.bin/tmux/tty-keys.c')
-rw-r--r--usr.bin/tmux/tty-keys.c57
1 files changed, 16 insertions, 41 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 10ee4ad7627..9a8ab2c7b25 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.129 2020/05/16 14:18:39 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.130 2020/05/16 14:30:17 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1070,28 +1070,13 @@ tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len,
",");
break;
case 'M': /* mintty */
- tty_add_features(&c->term_features,
- "256,"
- "RGB,"
- "title",
- ",");
+ tty_default_features(&c->term_features, "mintty", 0);
break;
case 'T': /* tmux */
- tty_add_features(&c->term_features,
- "256,"
- "RGB,"
- "ccolour,"
- "cstyle,"
- "overline,"
- "title,"
- "usstyle",
- ",");
+ tty_default_features(&c->term_features, "tmux", 0);
break;
case 'U': /* rxvt-unicode */
- tty_add_features(&c->term_features,
- "256,"
- "title",
- ",");
+ tty_default_features(&c->term_features, "rxvt-unicode", 0);
break;
}
log_debug("%s: received secondary DA %.*s", c->name, (int)*size, buf);
@@ -1112,7 +1097,7 @@ tty_keys_extended_device_attributes(struct tty *tty, const char *buf,
{
struct client *c = tty->client;
u_int i;
- char tmp[64];
+ char tmp[128];
*size = 0;
if (tty->flags & TTY_HAVEXDA)
@@ -1150,29 +1135,19 @@ tty_keys_extended_device_attributes(struct tty *tty, const char *buf,
*size = 5 + i;
/* Add terminal features. */
- if (strncmp(tmp, "iTerm2 ", 7) == 0) {
- tty_add_features(&c->term_features,
- "256,"
- "RGB,"
- "clipboard,"
- "cstyle,"
- "margins,"
- "sync,"
- "title",
- ",");
- } else if (strncmp(tmp, "tmux ", 5) == 0) {
- tty_add_features(&c->term_features,
- "256,"
- "RGB,"
- "ccolour,"
- "cstyle,"
- "overline,"
- "title,"
- "usstyle",
- ",");
- }
+ if (strncmp(tmp, "iTerm2 ", 7) == 0)
+ tty_default_features(&c->term_features, "iTerm2", 0);
+ else if (strncmp(tmp, "tmux ", 5) == 0)
+ tty_default_features(&c->term_features, "tmux", 0);
+ else if (strncmp(tmp, "XTerm(", 6) == 0)
+ tty_default_features(&c->term_features, "xterm", 0);
+ else if (strncmp(tmp, "mintty ", 7) == 0)
+ tty_default_features(&c->term_features, "mintty", 0);
log_debug("%s: received extended DA %.*s", c->name, (int)*size, buf);
+ free(c->term_type);
+ c->term_type = xstrdup(tmp);
+
tty_update_features(tty);
tty->flags |= TTY_HAVEXDA;