mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	feat(tui): try terminfo for [re]set_cursor_color OSC #19255
This commit is contained in:
		| @@ -2037,22 +2037,27 @@ static void augment_terminfo(TUIData *data, const char *term, long vte_version, | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   if (iterm || iterm_pretending_xterm) { |   data->unibi_ext.set_cursor_color = unibi_find_ext_str(ut, "Cs"); | ||||||
|     // FIXME: Bypassing tmux like this affects the cursor colour globally, in |   if (-1 == data->unibi_ext.set_cursor_color) { | ||||||
|     // all panes, which is not particularly desirable.  A better approach |     if (iterm || iterm_pretending_xterm) { | ||||||
|     // would use a tmux control sequence and an extra if(screen) test. |       // FIXME: Bypassing tmux like this affects the cursor colour globally, in | ||||||
|     data->unibi_ext.set_cursor_color = |       // all panes, which is not particularly desirable.  A better approach | ||||||
|       (int)unibi_add_ext_str(ut, NULL, TMUX_WRAP(tmux, "\033]Pl%p1%06x\033\\")); |       // would use a tmux control sequence and an extra if(screen) test. | ||||||
|   } else if ((xterm || rxvt || tmux || alacritty) |       data->unibi_ext.set_cursor_color = | ||||||
|              && (vte_version == 0 || vte_version >= 3900)) { |         (int)unibi_add_ext_str(ut, NULL, TMUX_WRAP(tmux, "\033]Pl%p1%06x\033\\")); | ||||||
|     // Supported in urxvt, newer VTE. |     } else if ((xterm || rxvt || tmux || alacritty) | ||||||
|     data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str(ut, "ext.set_cursor_color", |                && (vte_version == 0 || vte_version >= 3900)) { | ||||||
|                                                               "\033]12;#%p1%06x\007"); |       // 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) { |   if (-1 != data->unibi_ext.set_cursor_color) { | ||||||
|     data->unibi_ext.reset_cursor_color = (int)unibi_add_ext_str(ut, "ext.reset_cursor_color", |     data->unibi_ext.reset_cursor_color = unibi_find_ext_str(ut, "Cr"); | ||||||
|                                                                 "\x1b]112\x07"); |     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"); |   data->unibi_ext.save_title = (int)unibi_add_ext_str(ut, "ext.save_title", "\x1b[22;0t"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Wsevolod
					Wsevolod