summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tty-keys.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-06-10 07:21:11 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-06-10 07:21:11 +0000
commit5fe86a3c7b22f5f4e65ad37724b1a90cc430f8e5 (patch)
treed71b78ad18729ba6105086a1df104627843d5622 /usr.bin/tmux/tty-keys.c
parent4b8d5f7f864c45e8e305c519a7f4c3e69cb44ea7 (diff)
Add another couple of keys needed for extended keys, GitHub issue 2658.
Handle modifier 9 as Meta, GitHub issue 2647.
Diffstat (limited to 'usr.bin/tmux/tty-keys.c')
-rw-r--r--usr.bin/tmux/tty-keys.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 14adc1cc821..ed0041e4625 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.146 2021/04/13 12:26:34 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.147 2021/06/10 07:21:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -252,7 +252,8 @@ static const key_code tty_default_xterm_modifiers[] = {
KEYC_CTRL,
KEYC_SHIFT|KEYC_CTRL,
KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL,
- KEYC_SHIFT|KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL
+ KEYC_SHIFT|KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL,
+ KEYC_META|KEYC_IMPLIED_META
};
/*
@@ -944,6 +945,9 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
case 8:
nkey |= (KEYC_SHIFT|KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL);
break;
+ case 9:
+ nkey |= (KEYC_META|KEYC_IMPLIED_META);
+ break;
default:
*key = KEYC_NONE;
break;
@@ -955,7 +959,10 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
*/
if (nkey & KEYC_CTRL) {
onlykey = (nkey & KEYC_MASK_KEY);
- if (onlykey < 32 && onlykey != 9)
+ if (onlykey < 32 &&
+ onlykey != 9 &&
+ onlykey != 13 &&
+ onlykey != 27)
/* nothing */;
else if (onlykey >= 97 && onlykey <= 122)
onlykey -= 96;