From 0261e3978e3064176f57008d4ce6de18cb166b69 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 6 Feb 2023 17:46:37 +0000 Subject: patch 9.0.1287: with the Kitty key protocl Esc with NumLock cannot be mapped Problem: With the Kitty key protocl Esc with NumLock cannot be mapped. Solution: Also use K_ESC when there is a modifier. (closes #11811) --- src/term.c | 5 +++++ src/version.c | 2 ++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/term.c b/src/term.c index d7cece383..c90efe530 100644 --- a/src/term.c +++ b/src/term.c @@ -5349,6 +5349,11 @@ handle_key_with_modifier( if ((modifiers & MOD_MASK_SHIFT) && key >= 'a' && key <= 'z') key += 'A' - 'a'; + // Putting Esc in the buffer creates ambiguity, it can be the start of an + // escape sequence. Use K_ESC to avoid that. + if (key == ESC) + key = K_ESC; + return put_key_modifiers_in_typebuf(key, modifiers, csi_len, offset, buf, bufsize, buflen); } diff --git a/src/version.c b/src/version.c index 439698b32..9d5cb0fba 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1287, /**/ 1286, /**/ -- cgit v1.2.1