summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-04-13 12:26:35 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-04-13 12:26:35 +0000
commit2d3aec5efcb9bf67907ad5ff9e8e42e38e46f116 (patch)
tree6ba3bb41b4e3be731bb9ad329152bff099bc039a /usr.bin
parentc322e7b69e2c0eae0891a272c407da39b98ed407 (diff)
Change how extended ctrl keys are processed to fix C-S-Tab and C-;.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/tty-keys.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 0e210b85df6..14adc1cc821 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.145 2021/04/13 05:23:34 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.146 2021/04/13 12:26:34 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -955,23 +955,19 @@ 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) {
- if (onlykey != 9)
- onlykey = (nkey & ~KEYC_CTRL);
- else
- onlykey = (9|KEYC_CTRL);
- } else {
- if (onlykey >= 97 && onlykey <= 122)
- onlykey -= 96;
- else if (onlykey >= 64 && onlykey <= 95)
- onlykey -= 64;
- else if (onlykey == 32)
- onlykey = 0;
- else if (onlykey == 63)
- onlykey = 127;
- onlykey |= ((nkey & KEYC_MASK_MODIFIERS) & ~KEYC_CTRL);
- }
- nkey = onlykey;
+ if (onlykey < 32 && onlykey != 9)
+ /* nothing */;
+ else if (onlykey >= 97 && onlykey <= 122)
+ onlykey -= 96;
+ else if (onlykey >= 64 && onlykey <= 95)
+ onlykey -= 64;
+ else if (onlykey == 32)
+ onlykey = 0;
+ else if (onlykey == 63)
+ onlykey = 127;
+ else
+ onlykey |= KEYC_CTRL;
+ nkey = onlykey|((nkey & KEYC_MASK_MODIFIERS) & ~KEYC_CTRL);
}
if (log_get_level() != 0) {