[vim/vim] Cannot disable kitty keyboard protocol in vim :terminal (PR #19837)

4 views
Skip to first unread message

julio-b

unread,
Mar 26, 2026, 3:20:16 PM (15 hours ago) Mar 26
to vim/vim, Subscribed

In patch v9.0.0930 the kitty keyboard protocol was added to libvterm. But the
CSI sequence that disables this protocol is not handled correctly, and this
leaves the terminal window in a broken state. Here are the steps to reproduce:

  1. vim --clean
  2. :terminal<CR>
  3. In the terminal window shell, enable and then disable kitty keyboard protocol:
    $ printf '\x1b[>1u\x1b[<u'
  4. Try to use some shell key combination like <C-r>, <C-d> or <C-e> etc. They won't work because kitty keyboard is not disabled.

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19837

Commit Summary

  • ab1c77a Cannot disable kitty keyboard protocol in vim :terminal

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19837@github.com>

Christian Brabandt

unread,
Mar 26, 2026, 5:34:06 PM (13 hours ago) Mar 26
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19837)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19837/c4138357875@github.com>

julio-b

unread,
Mar 26, 2026, 5:36:25 PM (13 hours ago) Mar 26
to vim/vim, Subscribed
julio-b left a comment (vim/vim#19837)

The CI fails for some reason but it works locally.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19837/c4138380067@github.com>

Christian Brabandt

unread,
Mar 26, 2026, 5:37:17 PM (13 hours ago) Mar 26
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19837)

well, the new test fails for me, I suppose because I do not run it in a kitty terminal. Is there a way, to detect whether this runs inside a kitty terminal?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19837/c4138385349@github.com>

julio-b

unread,
Mar 26, 2026, 5:38:45 PM (13 hours ago) Mar 26
to vim/vim, Push

@julio-b pushed 1 commit.

  • 6a9fa04 Cannot disable kitty keyboard protocol in vim :terminal


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19837/before/ab1c77a12a5be2d40637638076784422a307d1e0/after/6a9fa04df9383b6a6a8801d7fcc767296535053b@github.com>

Christian Brabandt

unread,
Mar 26, 2026, 5:44:16 PM (12 hours ago) Mar 26
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19837)

For the record, the test fails for me in putty:

Found errors in Test_terminal_disable_kitty_keyboard():
command line..script /mnt/home/chrisbra/code/vim-upstream/src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_terminal_disable_kitty_keyboard[5]..WaitForAssert[2]..<SNR>4_WaitForCommon[11]..<lambda>115 line 1: Expected '^[[?1u^[[?0u' but got '\\x1b[>1u\\x1b[?u\\x1b[<u\\x1b[?u'
SKIPPED Test_terminal_eof_arg_win32_ctrl_z(): only works on MS-Windows

Can we do something like this:

+func Test_terminal_disable_kitty_keyboard()
+  CheckEnv KITTY_WINDOW_ID
+  let cmd = ['sh', '-c', 'printf ''\x1b[>1u\x1b[?u\x1b[<u\x1b[?u''']
+  let buf = term_start(cmd)
+  let job = term_getjob(buf)
+  call WaitForAssert({-> assert_equal('dead', job_status(job))})
+  call WaitForAssert({-> assert_equal('^[[?1u^[[?0u', term_getline(buf, 1))})
+  bwipe!
+endfunc


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19837/c4138427768@github.com>

julio-b

unread,
Mar 26, 2026, 6:19:03 PM (12 hours ago) Mar 26
to vim/vim, Subscribed
julio-b left a comment (vim/vim#19837)

well, the new test fails for me, I suppose because I do not run it in a kitty terminal. Is there a way, to detect whether this runs inside a kitty terminal?

The terminal you are running the test shouldn't matter at all. I have tried multiple terminals (xterm, ghostty, st and others) and it works just fine. Printing a literal '\x1b' in a portable way that works for every platform is very difficult. I will mark this as a draft and i will fix it tomorrow.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19837/c4138689556@github.com>

Reply all
Reply to author
Forward
0 new messages