diff options
author | nicm <nicm> | 2017-06-13 07:12:33 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-06-13 07:12:33 +0000 |
commit | ac7080b31b7d470467bd756d83c4803d6e0c3230 (patch) | |
tree | 0fc3ba8d3922ae12b8cdf3891742361ac308086e | |
parent | e028ab3476106dc66dc45943036add94173dedf6 (diff) | |
download | rtmux-ac7080b31b7d470467bd756d83c4803d6e0c3230.tar.gz rtmux-ac7080b31b7d470467bd756d83c4803d6e0c3230.tar.bz2 rtmux-ac7080b31b7d470467bd756d83c4803d6e0c3230.zip |
Remove xterm flag from key before checking prefix, reported by Peter
Fern in GitHub issue 974.
-rw-r--r-- | server-client.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server-client.c b/server-client.c index 5694a2a0..eee28883 100644 --- a/server-client.c +++ b/server-client.c @@ -818,6 +818,7 @@ server_client_handle_key(struct client *c, key_code key) struct key_binding bd_find, *bd; int xtimeout, flags; struct cmd_find_state fs; + key_code key0; /* Check the client is good to accept input. */ if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0) @@ -906,8 +907,9 @@ 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. */ - if ((key == (key_code)options_get_number(s->options, "prefix") || - key == (key_code)options_get_number(s->options, "prefix2")) && + key0 = (key & ~KEYC_XTERM); + if ((key0 == (key_code)options_get_number(s->options, "prefix") || + key0 == (key_code)options_get_number(s->options, "prefix2")) && strcmp(table->name, "prefix") != 0) { server_client_set_key_table(c, "prefix"); server_status_client(c); @@ -925,7 +927,7 @@ retry: log_debug("currently repeating"); /* Try to see if there is a key binding in the current table. */ - bd_find.key = (key & ~KEYC_XTERM); + bd_find.key = key0; bd = RB_FIND(key_bindings, &table->key_bindings, &bd_find); if (bd != NULL) { /* |