summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/key-string.c8
-rw-r--r--usr.bin/tmux/server-client.c8
-rw-r--r--usr.bin/tmux/tmux.h5
3 files changed, 16 insertions, 5 deletions
diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c
index 380f7886eb5..21d32e6b5ed 100644
--- a/usr.bin/tmux/key-string.c
+++ b/usr.bin/tmux/key-string.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key-string.c,v 1.47 2017/06/23 15:36:52 nicm Exp $ */
+/* $OpenBSD: key-string.c,v 1.48 2018/07/16 08:48:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -166,9 +166,11 @@ key_string_lookup_string(const char *string)
enum utf8_state more;
wchar_t wc;
- /* Is this no key? */
+ /* Is this no key or any key? */
if (strcasecmp(string, "None") == 0)
return (KEYC_NONE);
+ if (strcasecmp(string, "Any") == 0)
+ return (KEYC_ANY);
/* Is this a hexadecimal value? */
if (string[0] == '0' && string[1] == 'x') {
@@ -251,6 +253,8 @@ key_string_lookup_key(key_code key)
/* Handle special keys. */
if (key == KEYC_UNKNOWN)
return ("Unknown");
+ if (key == KEYC_ANY)
+ return ("Any");
if (key == KEYC_FOCUS_IN)
return ("FocusIn");
if (key == KEYC_FOCUS_OUT)
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index f8965946e70..95eb17e0701 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.251 2018/07/04 12:25:26 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.252 2018/07/16 08:48:22 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -907,8 +907,8 @@ server_client_handle_key(struct client *c, key_code key)
* The prefix always takes precedence and forces a switch to the prefix
* table, unless we are already there.
*/
-retry:
key0 = (key & ~KEYC_XTERM);
+retry:
if ((key0 == (key_code)options_get_number(s->options, "prefix") ||
key0 == (key_code)options_get_number(s->options, "prefix2")) &&
strcmp(table->name, "prefix") != 0) {
@@ -980,6 +980,10 @@ retry:
* switch the client back to the root table and try again.
*/
log_debug("not found in key table %s", table->name);
+ if (key0 != KEYC_ANY) {
+ key0 = KEYC_ANY;
+ goto retry;
+ }
if (!server_client_is_default_key_table(c, table) ||
(c->flags & CLIENT_REPEAT)) {
server_client_set_key_table(c, NULL);
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 1a63834b8d2..eeba3b4bede 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.828 2018/07/04 12:30:52 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.829 2018/07/16 08:48:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -136,6 +136,9 @@ enum {
KEYC_FOCUS_IN = KEYC_BASE,
KEYC_FOCUS_OUT,
+ /* "Any" key, used if not found in key table. */
+ KEYC_ANY,
+
/* Paste brackets. */
KEYC_PASTE_START,
KEYC_PASTE_END,