diff options
author | 2016-12-07 09:16:13 +0000 | |
---|---|---|
committer | 2016-12-07 09:16:13 +0000 | |
commit | 5684420b163e7674508a3209a98d2a46524e76dc (patch) | |
tree | 9e523ba719fc2a834a9bba0088a7eba1204c6192 /usr.bin/tmux/server-client.c | |
parent | sync (diff) | |
download | wireguard-openbsd-5684420b163e7674508a3209a98d2a46524e76dc.tar.xz wireguard-openbsd-5684420b163e7674508a3209a98d2a46524e76dc.zip |
Make prefix work in all tables (except the prefix table). Users who want
to avoid this can set prefix to "none" and bind send-prefix
themselves. Allows C-b t be bound in the copy mode tables again, pointed
out by millert@.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 152744ccb2a..19fecb3a14c 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.204 2016/11/24 18:45:45 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.205 2016/12/07 09:16:13 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -782,6 +782,18 @@ retry: else log_debug("key table %s (pane %%%u)", table->name, wp->id); + /* + * The prefix always takes precedence and forces a switch to the prefix + * table, unless we are already there. + */ + if ((key == (key_code)options_get_number(s->options, "prefix") || + key == (key_code)options_get_number(s->options, "prefix2")) && + strcmp(table->name, "prefix") != 0) { + server_client_set_key_table(c, "prefix"); + server_status_client(c); + return; + } + /* Try to see if there is a key binding in the current table. */ bd_find.key = key; bd = RB_FIND(key_bindings, &table->key_bindings, &bd_find); @@ -854,22 +866,12 @@ retry: /* If no match and we're not in the root table, that's it. */ if (name == NULL && !server_client_is_default_key_table(c)) { + log_debug("no key in key table %s", table->name); server_client_set_key_table(c, NULL); server_status_client(c); return; } - /* - * No match, but in the root table. Prefix switches to the prefix table - * and everything else is passed through. - */ - if (key == (key_code)options_get_number(s->options, "prefix") || - key == (key_code)options_get_number(s->options, "prefix2")) { - server_client_set_key_table(c, "prefix"); - server_status_client(c); - return; - } - forward: if (c->flags & CLIENT_READONLY) return; |