From 57490d47072405d93c190aaa699ac1a430e6e1c1 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 28 Feb 2022 09:24:22 +0000 Subject: [PATCH] Map control keys back to an ASCII uppercase letter when passing them on as extended keys. --- usr.bin/tmux/input-keys.c | 11 ++++++++--- 1 file 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 @@ -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; -- 2.20.1