From 72424ab5f5d00af01ae71baf17407f98032f439b Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 5 Feb 2023 13:29:35 +0100 Subject: Fixed OSC color reset without parameter->resets all colors Adapted from (garbled) patch by wim Additional notes: it should reset all the colors using xloadcols(). To reproduce: set a different (theme) color using some escape code, then reset it: printf '\x1b]104\x07' --- st.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index 5e6991a..e170309 100644 --- a/st.c +++ b/st.c @@ -2017,12 +2017,13 @@ strhandle(void) /* FALLTHROUGH */ case 104: /* color reset */ j = (narg > 1) ? atoi(strescseq.args[1]) : -1; - if (p && !strcmp(p, "?")) osc4_color_response(j); else if (xsetcolorname(j, p)) { - if (par == 104 && narg <= 1) + if (par == 104 && narg <= 1) { + xloadcols(); return; /* color reset without parameter */ + } fprintf(stderr, "erresc: invalid color j=%d, p=%s\n", j, p ? p : "(null)"); } else { -- cgit v1.2.3