mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Merge branch 'obsd-master'
This commit is contained in:
@ -166,9 +166,11 @@ key_string_lookup_string(const char *string)
|
|||||||
enum utf8_state more;
|
enum utf8_state more;
|
||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
|
|
||||||
/* Is this no key? */
|
/* Is this no key or any key? */
|
||||||
if (strcasecmp(string, "None") == 0)
|
if (strcasecmp(string, "None") == 0)
|
||||||
return (KEYC_NONE);
|
return (KEYC_NONE);
|
||||||
|
if (strcasecmp(string, "Any") == 0)
|
||||||
|
return (KEYC_ANY);
|
||||||
|
|
||||||
/* Is this a hexadecimal value? */
|
/* Is this a hexadecimal value? */
|
||||||
if (string[0] == '0' && string[1] == 'x') {
|
if (string[0] == '0' && string[1] == 'x') {
|
||||||
@ -251,6 +253,8 @@ key_string_lookup_key(key_code key)
|
|||||||
/* Handle special keys. */
|
/* Handle special keys. */
|
||||||
if (key == KEYC_UNKNOWN)
|
if (key == KEYC_UNKNOWN)
|
||||||
return ("Unknown");
|
return ("Unknown");
|
||||||
|
if (key == KEYC_ANY)
|
||||||
|
return ("Any");
|
||||||
if (key == KEYC_FOCUS_IN)
|
if (key == KEYC_FOCUS_IN)
|
||||||
return ("FocusIn");
|
return ("FocusIn");
|
||||||
if (key == KEYC_FOCUS_OUT)
|
if (key == KEYC_FOCUS_OUT)
|
||||||
|
@ -905,8 +905,8 @@ server_client_handle_key(struct client *c, key_code key)
|
|||||||
* The prefix always takes precedence and forces a switch to the prefix
|
* The prefix always takes precedence and forces a switch to the prefix
|
||||||
* table, unless we are already there.
|
* table, unless we are already there.
|
||||||
*/
|
*/
|
||||||
retry:
|
|
||||||
key0 = (key & ~KEYC_XTERM);
|
key0 = (key & ~KEYC_XTERM);
|
||||||
|
retry:
|
||||||
if ((key0 == (key_code)options_get_number(s->options, "prefix") ||
|
if ((key0 == (key_code)options_get_number(s->options, "prefix") ||
|
||||||
key0 == (key_code)options_get_number(s->options, "prefix2")) &&
|
key0 == (key_code)options_get_number(s->options, "prefix2")) &&
|
||||||
strcmp(table->name, "prefix") != 0) {
|
strcmp(table->name, "prefix") != 0) {
|
||||||
@ -978,6 +978,10 @@ retry:
|
|||||||
* switch the client back to the root table and try again.
|
* switch the client back to the root table and try again.
|
||||||
*/
|
*/
|
||||||
log_debug("not found in key table %s", table->name);
|
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) ||
|
if (!server_client_is_default_key_table(c, table) ||
|
||||||
(c->flags & CLIENT_REPEAT)) {
|
(c->flags & CLIENT_REPEAT)) {
|
||||||
server_client_set_key_table(c, NULL);
|
server_client_set_key_table(c, NULL);
|
||||||
|
3
tmux.h
3
tmux.h
@ -140,6 +140,9 @@ enum {
|
|||||||
KEYC_FOCUS_IN = KEYC_BASE,
|
KEYC_FOCUS_IN = KEYC_BASE,
|
||||||
KEYC_FOCUS_OUT,
|
KEYC_FOCUS_OUT,
|
||||||
|
|
||||||
|
/* "Any" key, used if not found in key table. */
|
||||||
|
KEYC_ANY,
|
||||||
|
|
||||||
/* Paste brackets. */
|
/* Paste brackets. */
|
||||||
KEYC_PASTE_START,
|
KEYC_PASTE_START,
|
||||||
KEYC_PASTE_END,
|
KEYC_PASTE_END,
|
||||||
|
Reference in New Issue
Block a user