summaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-06-02 15:06:12 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-06-02 15:06:12 -0400
commit3c1ef738a7327d4f2c0336c0a6a9e04769e6c730 (patch)
treea994e8fdaa7901e55216f64834e626abeab453f9 /st.c
parent9839f563e73b61008fe789107e0d0d2879834753 (diff)
parent22c71c355ca4f4e965c3d07e9ac37b0da7349255 (diff)
Merge branch 'master' of github.com:LukeSmithxyz/st
Diffstat (limited to 'st.c')
-rw-r--r--st.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/st.c b/st.c
index 192360b..0e5e3f5 100644
--- a/st.c
+++ b/st.c
@@ -1943,12 +1943,23 @@ strhandle(void)
}
return;
case 4: /* color set */
- if (narg < 3)
+ case 10: /* foreground set */
+ case 11: /* background set */
+ case 12: /* cursor color */
+ if ((par == 4 && narg < 3) || narg < 2)
break;
- p = strescseq.args[2];
+ p = strescseq.args[((par == 4) ? 2 : 1)];
/* FALLTHROUGH */
case 104: /* color reset, here p = NULL */
- j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
+ if (par == 10)
+ j = defaultfg;
+ else if (par == 11)
+ j = defaultbg;
+ else if (par == 12)
+ j = defaultcs;
+ else
+ j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
+
if (xsetcolorname(j, p)) {
if (par == 104 && narg <= 1)
return; /* color reset without parameter */
@@ -1959,6 +1970,8 @@ strhandle(void)
* TODO if defaultbg color is changed, borders
* are dirty
*/
+ if (j == defaultbg)
+ xclearwin();
redraw();
}
return;