aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruio23 <98493983+uio23@users.noreply.github.com>2025-02-03 22:09:47 +1300
committerGitHub <noreply@github.com>2025-02-03 01:09:47 -0800
commit720ec5cec2df6aca08c1410647f01584a48bac35 (patch)
tree245e8be63ab66a311b78ca78f8cb3d424bbf4d89
parent445ecca398401ab9cdada163865db6dee374dde3 (diff)
downloadrneovim-720ec5cec2df6aca08c1410647f01584a48bac35.tar.gz
rneovim-720ec5cec2df6aca08c1410647f01584a48bac35.tar.bz2
rneovim-720ec5cec2df6aca08c1410647f01584a48bac35.zip
fix(tui): cursor color in suckless terminal #32310
Problem: 's 'guicursor' cursor color not working in suckless terminal (ST). Nvim's builtin terminfo for ST lacks a "Cs" entry, even though ST does support the cursor color to be set via termcodes. Solution: - In `augment_terminfo()`, assume that `st` always supports color cursor. - Thomas Dickey will add a "Cs" entry for st to ncurses, from which Nvim's builtin terminfos are generated. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
-rw-r--r--src/nvim/tui/tui.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index f4337d5011..31f95a1006 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -2294,6 +2294,7 @@ static void augment_terminfo(TUIData *tui, const char *term, int vte_version, in
bool putty = terminfo_is_term_family(term, "putty");
bool screen = terminfo_is_term_family(term, "screen");
bool tmux = terminfo_is_term_family(term, "tmux") || !!os_getenv("TMUX");
+ bool st = terminfo_is_term_family(term, "st");
bool iterm = terminfo_is_term_family(term, "iterm")
|| terminfo_is_term_family(term, "iterm2")
|| terminfo_is_term_family(term, "iTerm.app")
@@ -2378,9 +2379,10 @@ static void augment_terminfo(TUIData *tui, const char *term, int vte_version, in
// would use a tmux control sequence and an extra if(screen) test.
tui->unibi_ext.set_cursor_color =
(int)unibi_add_ext_str(ut, NULL, TMUX_WRAP(tmux, "\033]Pl%p1%06x\033\\"));
- } else if ((xterm || hterm || rxvt || tmux || alacritty)
+ } else if ((xterm || hterm || rxvt || tmux || alacritty || st)
&& (vte_version == 0 || vte_version >= 3900)) {
// Supported in urxvt, newer VTE.
+ // Supported in st, but currently missing in ncurses definitions. #32217
tui->unibi_ext.set_cursor_color = (int)unibi_add_ext_str(ut, "ext.set_cursor_color",
"\033]12;%p1%s\007");
}