aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2023-02-05 13:29:35 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2023-02-05 13:29:35 +0100
commit7e8050cc621f27002eaf1be8114dee2497beff91 (patch)
tree1d6ef5475ad0c9301ade9ec0ab780ffce783067f
parente5e959835b195c023d1f685ef4dbbcfc3b5120b2 (diff)
downloadst-patched-7e8050cc621f27002eaf1be8114dee2497beff91.tar.bz2
st-patched-7e8050cc621f27002eaf1be8114dee2497beff91.tar.xz
st-patched-7e8050cc621f27002eaf1be8114dee2497beff91.zip
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'
-rw-r--r--st.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/st.c b/st.c
index 62def59..34c27ad 100644
--- a/st.c
+++ b/st.c
@@ -1932,8 +1932,10 @@ strhandle(void)
1932 if (p && !strcmp(p, "?")) { 1932 if (p && !strcmp(p, "?")) {
1933 osc_color_response(j, 0, 1); 1933 osc_color_response(j, 0, 1);
1934 } else if (xsetcolorname(j, p)) { 1934 } else if (xsetcolorname(j, p)) {
1935 if (par == 104 && narg <= 1) 1935 if (par == 104 && narg <= 1) {
1936 xloadcols();
1936 return; /* color reset without parameter */ 1937 return; /* color reset without parameter */
1938 }
1937 fprintf(stderr, "erresc: invalid color j=%d, p=%s\n", 1939 fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
1938 j, p ? p : "(null)"); 1940 j, p ? p : "(null)");
1939 } else { 1941 } else {