Mercurial > vim
diff src/term.c @ 31279:7e51449ab768 v9.0.0973
patch 9.0.0973: Kitty keyboard protocol key with NumLock not decoded
Commit: https://github.com/vim/vim/commit/064fd67e6a0283bb24732146fd20c92b6dbf47bf
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Nov 29 18:32:32 2022 +0000
patch 9.0.0973: Kitty keyboard protocol key with NumLock not decoded
Problem: Kitty keyboard protocol key not decoded when it has an unsupported
modifier, such as NumLock.
Solution: Accept a key with any modifier. (closes #11638)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 29 Nov 2022 19:45:03 +0100 |
parents | 68d13970fe8b |
children | cab7d8accab7 |
line wrap: on
line diff
--- a/src/term.c +++ b/src/term.c @@ -4693,6 +4693,8 @@ decode_modifiers(int n) modifiers |= MOD_MASK_CTRL; if (code & 8) modifiers |= MOD_MASK_META; + // Any further modifiers are silently dropped. + return modifiers; } @@ -5317,14 +5319,14 @@ handle_csi( // Key with modifier: // {lead}27;{modifier};{key}~ // {lead}{key};{modifier}u - // Only handles four modifiers, this won't work if the modifier value is - // more than 16. - else if (((arg[0] == 27 && argc == 3 && trail == '~') + // Even though we only handle four modifiers and the {modifier} value + // should be 16 or lower, we accept all modifier values to avoid the raw + // sequence to be passed through. + else if ((arg[0] == 27 && argc == 3 && trail == '~') || (argc == 2 && trail == 'u')) - && arg[1] <= 16) { return len + handle_key_with_modifier(arg, trail, - csi_len, offset, buf, bufsize, buflen); + csi_len, offset, buf, bufsize, buflen); } // Key without modifier (Kitty sends this for Esc):