diff options
author | mackarelfish <mackarelfish93@gmail.com> | 2020-05-31 10:23:03 +0700 |
---|---|---|
committer | mackarelfish <mackarelfish93@gmail.com> | 2020-05-31 10:23:03 +0700 |
commit | 6bf7545fc98cd0d42eb727d596215daac809c478 (patch) | |
tree | 1dd49c4a4819f4c4f22a09d9d36a5a129e7a6ceb /st.c | |
parent | 4edc7282ab841142e970dcb4f03f251bb5ed7292 (diff) | |
parent | 22c71c355ca4f4e965c3d07e9ac37b0da7349255 (diff) |
Merge branch 'master' of https://github.com/lukesmithxyz/st
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -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; |