Skip to content

Commit d13f135

Browse files
julio-bchrisbra
authored andcommitted
patch 9.2.0264: Cannot disable kitty keyboard protocol in vim :terminal
Problem: Cannot disable kitty keyboard protocol in vim :terminal Solution: Handle "CSI <u" sequence in libvterm (Julio B). related: v9.0.0930 closes: #19837 Signed-off-by: Julio B <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 8e29c35 commit d13f135

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/libvterm/src/state.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha
983983
switch(leader[0]) {
984984
case '?':
985985
case '>':
986+
case '<':
986987
leader_byte = leader[0];
987988
break;
988989
default:

src/testdir/test_terminal.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,4 +2441,14 @@ func Test_term_TextChangedT_close()
24412441
augroup END
24422442
endfunc
24432443

2444+
func Test_terminal_disable_kitty_keyboard()
2445+
CheckRunVimInTerminal
2446+
let cmd = ['sh', '-c', 'printf ''\033[>1u\033[?u\033[<u\033[?u''; sleep 1']
2447+
let buf = term_start(cmd)
2448+
let job = term_getjob(buf)
2449+
call WaitForAssert({-> assert_equal('dead', job_status(job))})
2450+
call WaitForAssert({-> assert_equal('^[[?1u^[[?0u', term_getline(buf, 1))})
2451+
bwipe!
2452+
endfunc
2453+
24442454
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
264,
737739
/**/
738740
263,
739741
/**/

0 commit comments

Comments
 (0)