Mercurial > vim
changeset 31213:d26436d305cc v9.0.0940
patch 9.0.0940: crash when typing a letter in a terminal window
Commit: https://github.com/vim/vim/commit/ebed1b0bea98390b400c913cfd9211a89b7275d8
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 24 14:05:19 2022 +0000
patch 9.0.0940: crash when typing a letter in a terminal window
Problem: Crash when typing a letter in a terminal window. (Shane-XB-Qian)
Solution: Use the "vterm" variable instead of getting the terminal pointer
from the current buffer. (closes #11608)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 24 Nov 2022 15:15:03 +0100 |
parents | f5cd10665f48 |
children | a4547feee66f |
files | src/terminal.c src/testdir/test_termcodes.vim src/version.c |
diffstat | 3 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/terminal.c +++ b/src/terminal.c @@ -1590,7 +1590,7 @@ term_convert_key(term_T *term, int c, in // Ctrl-Shift-i may have the key "I" instead of "i", but for the kitty // keyboard protocol should use "i". Applies to all ascii letters. if (ASCII_ISUPPER(c) - && vterm_is_kitty_keyboard(curbuf->b_term->tl_vterm) + && vterm_is_kitty_keyboard(vterm) && mod == (VTERM_MOD_CTRL | VTERM_MOD_SHIFT)) c = TOLOWER_ASC(c);
--- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -2156,6 +2156,9 @@ func Test_modifyOtherKeys_no_mapping() endfunc func Test_CSIu_keys_without_modifiers() + " make this execute faster + set timeoutlen=10 + " Escape sent as `CSI 27 u` should act as normal escape and not undo call setline(1, 'a') call feedkeys('a' .. GetEscCodeCSIuWithoutModifier("\e"), 'Lx!') @@ -2166,6 +2169,8 @@ func Test_CSIu_keys_without_modifiers() call setline(1, '') call feedkeys('a' .. GetEscCodeCSIuWithoutModifier("\t") .. "\<Esc>", 'Lx!') call assert_equal("\t", getline(1)) + + set timeoutlen& endfunc " Check that when DEC mouse codes are recognized a special key is handled.