diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2022-02-28 09:24:23 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2022-02-28 09:24:23 +0000 |
commit | 2a191f396de8a91510c99f24f6dc46954318438c (patch) | |
tree | f89516b05fddc279570fba66a61b72c6b7cef695 /usr.bin/tmux | |
parent | 4b40fa1bfa281e77a285d3fa7b4f437399c68382 (diff) |
Map control keys back to an ASCII uppercase letter when passing them on
as extended keys.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/input-keys.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c index c0d44ef45dd..4898043cb6a 100644 --- a/usr.bin/tmux/input-keys.c +++ b/usr.bin/tmux/input-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input-keys.c,v 1.87 2022/02/16 18:55:05 nicm Exp $ */ +/* $OpenBSD: input-keys.c,v 1.88 2022/02/28 09:24:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -418,7 +418,7 @@ int input_key(struct screen *s, struct bufferevent *bev, key_code key) { struct input_key_entry *ike; - key_code justkey, newkey, outkey; + key_code justkey, newkey, outkey, modifiers; struct utf8_data ud; char tmp[64], modifier; @@ -519,7 +519,12 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key) return (input_key(s, bev, key & ~KEYC_CTRL)); } outkey = (key & KEYC_MASK_KEY); - switch (key & KEYC_MASK_MODIFIERS) { + modifiers = (key & KEYC_MASK_MODIFIERS); + if (outkey < ' ') { + outkey = 64 + outkey; + modifiers |= KEYC_CTRL; + } + switch (modifiers) { case KEYC_SHIFT: modifier = '2'; break; |