aboutsummaryrefslogtreecommitdiff
path: root/tty-keys.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-08-29 12:01:25 +0100
committerThomas Adam <thomas@xteddy.org>2017-08-29 12:01:25 +0100
commit0f7160eb2f15204dc4ea5b35bb291986069a4526 (patch)
treee44ba3b9bd2d53341d4bd5e82e17d09d732cf283 /tty-keys.c
parent91d6bff8b83cea34d348172db56dd28baafbda80 (diff)
parent5fc0be50450e750c374e22345005e98011fa6465 (diff)
downloadrtmux-0f7160eb2f15204dc4ea5b35bb291986069a4526.tar.gz
rtmux-0f7160eb2f15204dc4ea5b35bb291986069a4526.tar.bz2
rtmux-0f7160eb2f15204dc4ea5b35bb291986069a4526.zip
Merge branch 'obsd-master'
Diffstat (limited to 'tty-keys.c')
-rw-r--r--tty-keys.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/tty-keys.c b/tty-keys.c
index 6e02bdc1..7c0455f0 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -595,7 +595,17 @@ tty_keys_next(struct tty *tty)
}
first_key:
- /* Handle keys starting with escape. */
+ /* Try to lookup complete key. */
+ n = tty_keys_next1(tty, buf, len, &key, &size, expired);
+ if (n == 0) /* found */
+ goto complete_key;
+ if (n == 1)
+ goto partial_key;
+
+ /*
+ * If not a complete key, look for key with an escape prefix (meta
+ * modifier).
+ */
if (*buf == '\033') {
/* Look for a key without the escape. */
n = tty_keys_next1(tty, buf + 1, len - 1, &key, &size, expired);
@@ -620,13 +630,6 @@ first_key:
goto partial_key;
}
- /* Try to lookup key. */
- n = tty_keys_next1(tty, buf, len, &key, &size, expired);
- if (n == 0) /* found */
- goto complete_key;
- if (n == 1)
- goto partial_key;
-
/*
* At this point, we know the key is not partial (with or without
* escape). So pass it through even if the timer has not expired.