diff --git a/input-keys.c b/input-keys.c index 80a477f9..b97f7c89 100644 --- a/input-keys.c +++ b/input-keys.c @@ -542,12 +542,16 @@ input_key_mode1(struct bufferevent *bev, key_code key) log_debug("%s: key in %llx", __func__, key); + /* A regular or shifted key + Meta. */ + if ((key & (KEYC_CTRL | KEYC_META)) == KEYC_META) + return (input_key_vt10x(bev, key)); + /* * As per * https://invisible-island.net/xterm/modified-keys-us-pc105.html. */ onlykey = key & KEYC_MASK_KEY; - if ((key & (KEYC_META | KEYC_CTRL)) == KEYC_CTRL && + if ((key & KEYC_CTRL) && (onlykey == ' ' || onlykey == '/' || onlykey == '@' || @@ -556,13 +560,6 @@ input_key_mode1(struct bufferevent *bev, key_code key) (onlykey >= '@' && onlykey <= '~'))) return (input_key_vt10x(bev, key)); - /* - * A regular key + Meta. In the absence of a standard to back this, we - * mimic what iTerm 2 does. - */ - if ((key & (KEYC_CTRL | KEYC_META)) == KEYC_META) - return (input_key_vt10x(bev, key)); - return (-1); }