diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2023-02-05 13:29:35 +0100 |
---|---|---|
committer | Rafael Marçalo <raroma09@gmail.com> | 2023-02-05 13:05:50 +0000 |
commit | 72424ab5f5d00af01ae71baf17407f98032f439b (patch) | |
tree | f22b7198f05e96a6c07cc666603c6912aee1cd58 /st.c | |
parent | 8c50949c902765468784535d61382c767237c1e4 (diff) |
Fixed OSC color reset without parameter->resets all colors
Adapted from (garbled) patch by wim <wim@thinkerwim.org>
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'
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 { |