diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 8ba17d4362..d9b360a570 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -2363,9 +2363,7 @@ static void patch_terminfo_bugs(TUIData *tui, const char *term, const char *colo // DECSCUSR (cursor shape) is widely supported. // https://github.com/gnachman/iTerm2/pull/92 if (!bsdvt - && (xterm // anything claiming xterm compat - // per MinTTY 0.4.3-1 release notes from 2009 - || putty + && (putty // per MinTTY 0.4.3-1 release notes from 2009 // per https://chromium.googlesource.com/apps/libapps/+/a5fb83c190aa9d74f4a9bca233dac6be2664e9e9/hterm/doc/ControlSequences.md || hterm // per https://bugzilla.gnome.org/show_bug.cgi?id=720821 @@ -2411,6 +2409,11 @@ static void patch_terminfo_bugs(TUIData *tui, const char *term, const char *colo "%e%{0}" // anything else "%;" "%dc"); terminfo_set_str(tui, kTerm_reset_cursor_style, "\x1b[?c"); + } else if (!bsdvt && xterm) { + terminfo_set_if_empty(tui, kTerm_set_cursor_style, "\x1b[%p1%d q"); + // xterm has a configurable cursor, but the default is 2, and 0 doesn't + // reset to default. #41047 + terminfo_set_if_empty(tui, kTerm_reset_cursor_style, "\x1b[2 q"); } xfree(xterm_version);