aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWsevolod <kefirchik3@gmail.com>2022-07-07 12:09:11 +0300
committerGitHub <noreply@github.com>2022-07-07 02:09:11 -0700
commit34d41baf8a8e4ab8c006b7f29a8106e60e311aa2 (patch)
tree9ce68a3465c2292131c2e3cc634e4a8456d0cb88
parent55e81b0fe8bb205b579c1da24b3ac042191a4bbf (diff)
downloadrneovim-34d41baf8a8e4ab8c006b7f29a8106e60e311aa2.tar.gz
rneovim-34d41baf8a8e4ab8c006b7f29a8106e60e311aa2.tar.bz2
rneovim-34d41baf8a8e4ab8c006b7f29a8106e60e311aa2.zip
feat(tui): try terminfo for [re]set_cursor_color OSC #19255
-rw-r--r--src/nvim/tui/tui.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 68df5819e2..20cf1ed586 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -2037,22 +2037,27 @@ static void augment_terminfo(TUIData *data, const char *term, long vte_version,
}
}
- if (iterm || iterm_pretending_xterm) {
- // FIXME: Bypassing tmux like this affects the cursor colour globally, in
- // all panes, which is not particularly desirable. A better approach
- // would use a tmux control sequence and an extra if(screen) test.
- data->unibi_ext.set_cursor_color =
- (int)unibi_add_ext_str(ut, NULL, TMUX_WRAP(tmux, "\033]Pl%p1%06x\033\\"));
- } else if ((xterm || rxvt || tmux || alacritty)
- && (vte_version == 0 || vte_version >= 3900)) {
- // Supported in urxvt, newer VTE.
- data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str(ut, "ext.set_cursor_color",
- "\033]12;#%p1%06x\007");
+ data->unibi_ext.set_cursor_color = unibi_find_ext_str(ut, "Cs");
+ if (-1 == data->unibi_ext.set_cursor_color) {
+ if (iterm || iterm_pretending_xterm) {
+ // FIXME: Bypassing tmux like this affects the cursor colour globally, in
+ // all panes, which is not particularly desirable. A better approach
+ // would use a tmux control sequence and an extra if(screen) test.
+ data->unibi_ext.set_cursor_color =
+ (int)unibi_add_ext_str(ut, NULL, TMUX_WRAP(tmux, "\033]Pl%p1%06x\033\\"));
+ } else if ((xterm || rxvt || tmux || alacritty)
+ && (vte_version == 0 || vte_version >= 3900)) {
+ // Supported in urxvt, newer VTE.
+ data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str(ut, "ext.set_cursor_color",
+ "\033]12;#%p1%06x\007");
+ }
}
-
if (-1 != data->unibi_ext.set_cursor_color) {
- data->unibi_ext.reset_cursor_color = (int)unibi_add_ext_str(ut, "ext.reset_cursor_color",
- "\x1b]112\x07");
+ data->unibi_ext.reset_cursor_color = unibi_find_ext_str(ut, "Cr");
+ if (-1 == data->unibi_ext.reset_cursor_color) {
+ data->unibi_ext.reset_cursor_color = (int)unibi_add_ext_str(ut, "ext.reset_cursor_color",
+ "\x1b]112\x07");
+ }
}
data->unibi_ext.save_title = (int)unibi_add_ext_str(ut, "ext.save_title", "\x1b[22;0t");