[vim/vim] Cursor blink setting is overriden by kitty when using `&term = "xterm-kitty"` (Issue #20739)

8 views
Skip to first unread message

AnonymousRand

unread,
Jul 10, 2026, 1:07:15 AM (yesterday) Jul 10
to vim/vim, Subscribed
AnonymousRand created an issue (vim/vim#20739)

Steps to reproduce

  1. Set up a minimal install of kitty with no config (or run kitty --config=NONE).
  2. Use the following vimrc:
    let &t_EI = "\e[2 q" " steady block cursor in normal mode
    let &t_SI = "\e[5 q" " blinking line cursor in insert mode
    
    let &t_AU = "\e[58:5:%dm"
    let &t_8u = "\e[58:2:%lu:%lu:%lum"
    let &t_Us = "\e[4:2m"
    let &t_Cs = "\e[4:3m"
    let &t_ds = "\e[4:4m"
    let &t_Ds = "\e[4:5m"
    let &t_Ce = "\e[4:0m"
    let &t_Ts = "\e[9m"
    let &t_Te = "\e[29m"
    let &t_8f = "\e[38:2:%lu:%lu:%lum"
    let &t_8b = "\e[48:2:%lu:%lu:%lum"
    let &t_RF = "\e]10;?\e\\"
    let &t_RB = "\e]11;?\e\\"
    let &t_BE = "\e[?2004h"
    let &t_BD = "\e[?2004l"
    let &t_PS = "\e[200~"
    let &t_PE = "\e[201~"
    let &t_RC = "\e[?12$p"
    let &t_SH = "\e[%d q"
    let &t_RS = "\eP$q q\e\\"
    let &t_VS = "\e[?12l"
    let &t_fe = "\e[?1004h"
    let &t_fd = "\e[?1004l"
    execute "set <FocusGained>=\<Esc>[I"
    execute "set <FocusLost>=\<Esc>[O"
    let &t_ST = "\e[22;2t"
    let &t_RT = "\e[23;2t"
    let &t_ut=''
  3. Run vim inside kitty. Observe that the normal mode cursor is a blinking block instead of a steady block as set in the vimrc, i.e. both normal and insert mode cursors blink. If kitty is instead configured to not blink cursors (cursor_blink_interval 0), both normal and insert mode cursors are steady.

Expected behaviour

As set in the vimrc, the normal mode cursor should be steady, while the insert mode one should blink. The expected behavior is observed if &term is set to xterm-256color instead of the default xterm-kitty in vimrc. Using printf <escape code>; cat at the kitty command line also prints cursors with the correct blink state, so this bug should not be within kitty.

Version of Vim

9.2.389

Environment

Operating system: NixOS 26.05
Terminal: kitty 0.47.0
Value of $TERM: xterm-kitty
Shell: observed in both bash 5.3.9 and fish 4.7.1

Also, the long list of commands in the vimrc after setting the cursor initially is the "vim fixes" from kitty docs; the bug happens both with and without this.

Logs and stack traces


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20739@github.com>

h_east

unread,
Jul 10, 2026, 4:26:25 PM (23 hours ago) Jul 10
to vim/vim, Subscribed
h-east left a comment (vim/vim#20739)

Thanks for the detailed report.

This is a conflict between two blink-control mechanisms. Capturing the exact
bytes Vim writes for the Normal-mode cursor, with your vimrc and only $TERM
changed:

$TERM=xterm-256color :  \e[2 q  \e[?25h
$TERM=xterm-kitty    :  \e[2 q  \e[?12l  \e[?25h

The extra \e[?12l comes from t_ve, which Vim emits on every redraw:

  • xterm-256color: vim_is_xterm() is true, so Vim uses its built-in xterm entry,
    where t_ve is \e[?25h (does not touch blinking).
  • xterm-kitty: vim_is_xterm() is intentionally false (see os_unix.c), so Vim
    uses terminfo, where t_ve is cnorm = \e[?12l\e[?25h.

t_EI sets a steady shape via DECSCUSR once per mode change, but the trailing
\e[?12l from t_ve is written on every redraw and wins, which matches the
behavior you describe. So DECSCUSR and DEC mode 12 fight; the built-in xterm
entry avoids this by keeping \e[?12l out of t_ve.

Workaround:

let &t_ve = "\e[?25h"

This makes the Normal-mode output \e[2 q \e[?25h, same as xterm-256color, and
the steady cursor is preserved.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20739/4939265174@github.com>

Reply all
Reply to author
Forward
0 new messages