diff options
author | nicm <nicm> | 2016-12-07 09:16:13 +0000 |
---|---|---|
committer | nicm <nicm> | 2016-12-07 09:16:13 +0000 |
commit | a8f3ad448715cdb5bf0a4aa240064b4e86fae1e9 (patch) | |
tree | e95ff68a449136b3c3c025f0dd869d15e4a4154b /server-client.c | |
parent | 1a6156d8fdc1ff53cd5987a0e6d2d3eeaaadc2ed (diff) | |
download | rtmux-a8f3ad448715cdb5bf0a4aa240064b4e86fae1e9.tar.gz rtmux-a8f3ad448715cdb5bf0a4aa240064b4e86fae1e9.tar.bz2 rtmux-a8f3ad448715cdb5bf0a4aa240064b4e86fae1e9.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 'server-client.c')
-rw-r--r-- | server-client.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/server-client.c b/server-client.c index 4d9d3102..b45265b7 100644 --- a/server-client.c +++ b/server-client.c @@ -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; |