diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-03-21 21:28:03 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-03-21 21:28:03 +0000 |
commit | 7c9d003e99eff8d9a935102e47662f681e7629bb (patch) | |
tree | edfc0d054b7a6978bfa1817609d07b47ab528007 | |
parent | 49ce38b09a68830d313e60dc78b9cf3fd4fbb8e1 (diff) | |
download | rtmux-7c9d003e99eff8d9a935102e47662f681e7629bb.tar.gz rtmux-7c9d003e99eff8d9a935102e47662f681e7629bb.tar.bz2 rtmux-7c9d003e99eff8d9a935102e47662f681e7629bb.zip |
Some terminals respond to secondary DA with primary (they ignore the
intermediate character). So ignore the possible responses to primary DA.
-rw-r--r-- | tty-keys.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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 == ';') { |