summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-04-13 05:23:35 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-04-13 05:23:35 +0000
commite7ebdc99701a285ee268108c95228e2d0594e68a (patch)
tree816a847b6d1b5e0bb9d0bf16e0260a70110c4511 /usr.bin
parentb8a8d5c6cfb6e964ade4a254d21a1b16cbdf8486 (diff)
Handle C-Tab correctly with extended keys, GitHub issue 2642.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/tty-keys.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 78b8090bdbf..0e210b85df6 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.144 2021/04/07 15:46:12 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.145 2021/04/13 05:23:34 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -953,11 +953,14 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
* Don't allow both KEYC_CTRL and as an implied modifier. Also convert
* C-X into C-x and so on.
*/
- if (nkey & KEYC_CTRL){
+ if (nkey & KEYC_CTRL) {
onlykey = (nkey & KEYC_MASK_KEY);
- if (onlykey < 32)
- onlykey = (nkey & ~KEYC_CTRL);
- else {
+ 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)