summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2018-11-07 08:06:29 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2018-11-07 08:06:29 +0000
commit331ce7de84209c0a2e4c4835d588a0cfa6befd4f (patch)
treee5534f1e5eb6da1450a218ff8fdd4601a76b6db3 /usr.bin/tmux
parentb97996f1b3b1e4e05c244747eb32852b24543bde (diff)
If a non-repeating key is used when repeating, it should be treated as
an entirely new key press, not checked in root table and ignored if not found. GitHub issue 1513.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/server-client.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index f43992f6a8b..27c96891d32 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.261 2018/10/18 08:38:01 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.262 2018/11/07 08:06:28 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1022,6 +1022,7 @@ table_changed:
}
flags = c->flags;
+try_again:
/* Log key table. */
if (wp == NULL)
log_debug("key table %s (no pane)", table->name);
@@ -1030,7 +1031,6 @@ table_changed:
if (c->flags & CLIENT_REPEAT)
log_debug("currently repeating");
-try_again:
/* Try to see if there is a key binding in the current table. */
bd = key_bindings_get(table, key0);
if (bd != NULL) {
@@ -1041,10 +1041,12 @@ try_again:
*/
if ((c->flags & CLIENT_REPEAT) &&
(~bd->flags & KEY_BINDING_REPEAT)) {
+ log_debug("found in key table %s (not repeating)",
+ table->name);
server_client_set_key_table(c, NULL);
+ first = table = c->keytable;
c->flags &= ~CLIENT_REPEAT;
server_status_client(c);
- table = c->keytable;
goto table_changed;
}
log_debug("found in key table %s", table->name);
@@ -1094,10 +1096,13 @@ try_again:
log_debug("not found in key table %s", table->name);
if (!server_client_is_default_key_table(c, table) ||
(c->flags & CLIENT_REPEAT)) {
+ log_debug("trying in root table");
server_client_set_key_table(c, NULL);
+ table = c->keytable;
+ if (c->flags & CLIENT_REPEAT)
+ first = table;
c->flags &= ~CLIENT_REPEAT;
server_status_client(c);
- table = c->keytable;
goto table_changed;
}