From 550f2b8e3ddb02f2ceddb103fdbb4dfc6a6a4d6c Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 22 Feb 2021 08:29:10 +0100 Subject: added osc patch --- config.def.h | 7 ++++--- readme.md | 1 + st | Bin 106800 -> 110408 bytes st.c | 30 ++++++++++++++++++++++++++++++ st.h | 1 + 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/config.def.h b/config.def.h index 1bdb4f4..e621daf 100644 --- a/config.def.h +++ b/config.def.h @@ -124,6 +124,7 @@ static const char *colorname[] = { "#cccccc", "#555555", "black", + "gray90", }; @@ -131,10 +132,10 @@ static const char *colorname[] = { * Default colors (colorname index) * foreground, background, cursor, reverse cursor */ -unsigned int defaultfg = 7; unsigned int defaultbg = 258; -static unsigned int defaultcs = 256; -static unsigned int defaultrcs = 257; +unsigned int defaultfg = 259; +unsigned int defaultcs = 256; +unsigned int defaultrcs = 257; /* * Default shape of cursor diff --git a/readme.md b/readme.md index 490af4d..216ecb9 100644 --- a/readme.md +++ b/readme.md @@ -9,4 +9,5 @@ This is my custom build of st, including the following patches: - st-scrollback-mouse - st-xresources - st-desktopentry +- st-osc diff --git a/st b/st index 0d0d3d9..a100471 100755 Binary files a/st and b/st differ diff --git a/st.c b/st.c index 8769a9f..69839f3 100644 --- a/st.c +++ b/st.c @@ -1931,6 +1931,36 @@ strhandle(void) } } return; + case 10: /* set foreground color */ + if (narg < 2) + break; + + p = strescseq.args[1]; + if (xsetcolorname(defaultfg, p)) + fprintf(stderr, "erresc: invalid foreground color %d\n", p); + else + redraw(); + break; + case 11: /* set background color */ + if (narg < 2) + break; + + p = strescseq.args[1]; + if (xsetcolorname(defaultbg, p)) + fprintf(stderr, "erresc: invalid background color %d\n", p); + else + redraw(); + break; + case 12: /* set cursor color */ + if (narg < 2) + break; + + p = strescseq.args[1]; + if (xsetcolorname(defaultcs, p)) + fprintf(stderr, "erresc: invalid cursor color %d\n", p); + else + redraw(); + break; case 4: /* color set */ if (narg < 3) break; diff --git a/st.h b/st.h index 089b92d..6e5c836 100644 --- a/st.h +++ b/st.h @@ -127,4 +127,5 @@ extern char *termname; extern unsigned int tabspaces; extern unsigned int defaultfg; extern unsigned int defaultbg; +extern unsigned int defaultcs; extern float alpha; -- cgit v1.2.3