From 679862aa94b4f4a368dd95487d925c587b464ebe Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 8 Feb 2023 21:01:00 +0530 Subject: [PATCH] When changing the cursor text color via escape codes or remote control to a fixed color, do not ignore cursor_text_color Fixes #5994 --- docs/changelog.rst | 2 ++ kitty/shaders.c | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 1d53741b3..44180fb94 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -44,6 +44,8 @@ Detailed list of changes - launch: When using ``--cwd=current`` for a remote system support running non shell commands as well (:disc:`5987`) +- When changing the cursor text color via escape codes or remote control to a fixed color, do not reset cursor_text_color (:iss:`5994`) + 0.27.1 [2023-02-07] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/shaders.c b/kitty/shaders.c index 4594e980f..e09fd9217 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -348,11 +348,7 @@ cell_update_uniform_block(ssize_t vao_idx, Screen *screen, int uniform_buffer, c linebuf_init_line(screen->linebuf, screen->cursor->y); colors_for_cell(screen->linebuf->line, screen->color_profile, &cell_color_x, &cell_fg, &cell_bg, &reversed); } - if (screen->color_profile->overridden.cursor_color.type == COLOR_IS_INDEX || screen->color_profile->overridden.cursor_color.type == COLOR_IS_RGB) { - // since the program is controlling the cursor color we hope it has chosen one - // that has good contrast with the text color of the cell - rd->cursor_fg = cell_fg; rd->cursor_bg = COLOR(cursor_color); - } else if (IS_SPECIAL_COLOR(cursor_color)) { + if (IS_SPECIAL_COLOR(cursor_color)) { if (cursor_ok) pick_cursor_color(screen->linebuf->line, screen->color_profile, cell_fg, cell_bg, cell_color_x, &rd->cursor_fg, &rd->cursor_bg, rd->default_fg, rd->default_bg); else { rd->cursor_fg = rd->default_bg; rd->cursor_bg = rd->default_fg; } if (cell_bg == cell_fg) {