From 5d4a002413cdf09aa471e29b0a7ae29f7cf7b89c Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 1 Jul 2024 17:24:50 +0200 Subject: osc: merge OSC 10/11/12/17/19 handling 10/11/17/19 were already merged, so this patch just stops special casing 12 (cursor color). In preparation for XTPUSHCOLORS/XTPOPCOLORS, the cursor colors are moved from their own struct, into the 'colors' struct. Also fix a bug where OSC 17/19 queries returned OSC-11 data. --- terminal.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 0518e57d..caa8aa5a 100644 --- a/terminal.c +++ b/terminal.c @@ -1221,6 +1221,8 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper, .fg = conf->colors.fg, .bg = conf->colors.bg, .alpha = conf->colors.alpha, + .cursor_fg = conf->cursor.color.text, + .cursor_bg = conf->cursor.color.cursor, .selection_fg = conf->colors.selection_fg, .selection_bg = conf->colors.selection_bg, .use_custom_selection = conf->colors.use_custom.selection, @@ -1233,10 +1235,6 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper, .state = CURSOR_BLINK_ON, .fd = -1, }, - .cursor_color = { - .text = conf->cursor.color.text, - .cursor = conf->cursor.color.cursor, - }, .selection = { .coords = { .start = {-1, -1}, @@ -2035,6 +2033,8 @@ term_reset(struct terminal *term, bool hard) term->colors.fg = term->conf->colors.fg; term->colors.bg = term->conf->colors.bg; term->colors.alpha = term->conf->colors.alpha; + term->colors.cursor_fg = term->conf->cursor.color.text; + term->colors.cursor_bg = term->conf->cursor.color.cursor; term->colors.selection_fg = term->conf->colors.selection_fg; term->colors.selection_bg = term->conf->colors.selection_bg; term->colors.use_custom_selection = term->conf->colors.use_custom.selection; @@ -2051,8 +2051,6 @@ term_reset(struct terminal *term, bool hard) term->cursor_blink.decset = false; term->cursor_blink.deccsusr = term->conf->cursor.blink.enabled; term_cursor_blink_update(term); - term->cursor_color.text = term->conf->cursor.color.text; - term->cursor_color.cursor = term->conf->cursor.color.cursor; selection_cancel(term); term->normal.offset = term->normal.view = 0; term->alt.offset = term->alt.view = 0; -- cgit v1.3