From c6640adde342ee2c7e0ce4b4adc5de8417925a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 12 Aug 2019 20:00:28 +0200 Subject: [PATCH] render: fix foreground color for non-block cursor When rendering either the 'bar' or 'underline' cursor styles, only use the configured "cursor color" if it has actually been configured. If it hasn't, use the current foreground color. --- render.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/render.c b/render.c index b94b124a..1e3b9960 100644 --- a/render.c +++ b/render.c @@ -195,7 +195,10 @@ render_cell(struct terminal *term, cairo_t *cr, /* Non-block cursors */ if (has_cursor) { - struct rgb cursor_color = color_hex_to_rgb(term->cursor_color.cursor); + struct rgb cursor_color = term->cursor_color.text >> 31 + ? color_hex_to_rgb(term->cursor_color.cursor) + : fg; + if (term->cursor_style == CURSOR_BAR) draw_bar(term, cr, cursor_color, x, y); else if (term->cursor_style == CURSOR_UNDERLINE)