diff options
author | 2012-03-21 21:28:03 +0000 | |
---|---|---|
committer | 2012-03-21 21:28:03 +0000 | |
commit | cab6c0b3c01c1198c84c167286c1fa58f6267571 (patch) | |
tree | 807ef395aa662d1fb45fcf36f355c0a62e573366 /usr.bin/tmux/tty-keys.c | |
parent | Fix save-buffer usage, from Kazuhiko Sakaguchi. (diff) | |
download | wireguard-openbsd-cab6c0b3c01c1198c84c167286c1fa58f6267571.tar.xz wireguard-openbsd-cab6c0b3c01c1198c84c167286c1fa58f6267571.zip |
Some terminals respond to secondary DA with primary (they ignore the
intermediate character). So ignore the possible responses to primary DA.
Diffstat (limited to 'usr.bin/tmux/tty-keys.c')
-rw-r--r-- | usr.bin/tmux/tty-keys.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index f5ce2b77359..e2ab32dc436 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.37 2012/03/17 22:56:04 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.38 2012/03/21 21:28:03 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -686,9 +686,9 @@ tty_keys_device(struct tty *tty, const char *buf, size_t len, size_t *size) char tmp[64], *endptr; /* - * Secondary device attributes are \033[>a;b;c. We only request - * attributes on xterm, so we only care about the middle values which - * is the xterm version. + * Primary device attributes are \033[?a;b and secondary are + * \033[>a;b;c. We only request attributes on xterm, so we only care + * about the middle values which is the xterm version. */ *size = 0; @@ -702,7 +702,7 @@ tty_keys_device(struct tty *tty, const char *buf, size_t len, size_t *size) return (-1); if (len == 2) return (1); - if (buf[2] != '>') + if (buf[2] != '>' && buf[2] != '?') return (-1); if (len == 3) return (1); @@ -718,6 +718,10 @@ tty_keys_device(struct tty *tty, const char *buf, size_t len, size_t *size) tmp[i] = '\0'; *size = 4 + i; + /* Only secondary is of interest. */ + if (buf[2] != '>') + return (0); + /* Convert version numbers. */ a = strtoul(tmp, &endptr, 10); if (*endptr == ';') { |