From 224ad8a538e33ce3c868fcad2e9f70a1f7096594 Mon Sep 17 00:00:00 2001 From: Vadim Misbakh-Soloviov Date: Sun, 14 Jun 2026 22:43:44 +0700 Subject: [PATCH] fix(tui): more compatible way to reset cursor #40234 Problem: All (tested by me) terminals (xterm, st, ghostty, vte, foot, wezterm, konsole) do support `\x1b[0 q` as "reset cursor to default", but at least konsole and wezterm only understands `\x1b[0 q` as "reset to default", but have different behaviour on `\x1b[ q` (konsole sets "steady block", and wezterm does nothing (do not change cursor shape). Solution: Use `\x1b[0 q` would be more widely compatible "reset" sequence than `\x1b[ q` P.S. actually, `xterm`, `ghostty` and `st` (with default config.h) sets "steady block" for both sequence, but still here `[0` behaves the same as `[` --- src/nvim/tui/tui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index cc378e2607..92fc6c159f 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -2378,7 +2378,7 @@ static void patch_terminfo_bugs(TUIData *tui, const char *term, const char *colo || (linuxvt && (xterm_version || (vte_version > 0) || colorterm)))) { terminfo_set_str(tui, kTerm_set_cursor_style, "\x1b[%p1%d q"); - terminfo_set_str(tui, kTerm_reset_cursor_style, "\x1b[ q"); + terminfo_set_str(tui, kTerm_reset_cursor_style, "\x1b[0 q"); } else if (linuxvt) { // Linux uses an idiosyncratic escape code to set the cursor shape and // does not support DECSCUSR.