[wiki] [sites] Added patch for the proper implementation of OSC 10/11. || Raheman Vaiya

From: <git_AT_suckless.org>
Date: Sun, 17 Jan 2021 00:36:50 +0100

commit 79c4343555f39d9e73b56d4a4cfd3efabccd2d8b
Author: Raheman Vaiya <r.vaiya_AT_gmail.com>
Date: Sat Jan 16 18:35:37 2021 -0500

    Added patch for the proper implementation of OSC 10/11.

diff --git a/st.suckless.org/patches/osc_10_11_12_#2/index.md b/st.suckless.org/patches/osc_10_11_12_#2/index.md
new file mode 100644
index 00000000..27f3750f
--- /dev/null
+++ b/st.suckless.org/patches/osc_10_11_12_#2/index.md
_AT_@ -0,0 +1,21 @@
+OSC 10, 11, 12 #2
+==============
+
+Description
+-----------
+
+This patch adds support for OSC 10, 11, and 12 in the way they are implemented
+in most other terminals (e.g libvte, kitty). Specifically it differs from
+osc_10_11_12 in that it treats the background and foreground colors as distinct
+from palette colours 01 and 07 in order to facilitate the use of theme setting
+scripts like [theme.sh](https://github.com/lemnos/theme.sh) which expect these
+colours to be distinct.
+
+
+Download
+--------
+* [st-osc10-20210106-4ef0cbd.diff](st-osc10-20210106-4ef0cbd.diff)
+
+Authors
+-------
+* Raheman Vaiya - <r.vaiya at gmail dot com>
diff --git a/st.suckless.org/patches/osc_10_11_12_#2/st-osc10-20210106-9c4b3f4.diff b/st.suckless.org/patches/osc_10_11_12_#2/st-osc10-20210106-9c4b3f4.diff
new file mode 100644
index 00000000..728c433f
--- /dev/null
+++ b/st.suckless.org/patches/osc_10_11_12_#2/st-osc10-20210106-9c4b3f4.diff
_AT_@ -0,0 +1,91 @@
+From 9c4b3f40e07dd1d6dd94fa733b7853aff7f4b8fc Mon Sep 17 00:00:00 2001
+From: Raheman Vaiya <r.vaiya_AT_gmail.com>
+Date: Sat, 16 Jan 2021 18:18:07 -0500
+Subject: [PATCH] Add proper OSC 10/11 support.
+
+---
+ config.def.h | 9 ++++++---
+ st.c | 30 ++++++++++++++++++++++++++++++
+ st.h | 1 +
+ 3 files changed, 37 insertions(+), 3 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 6f05dce..9bb22a5 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -120,6 +120,8 @@ static const char *colorname[] = {
+ /* more colors can be added after 255 to use with DefaultXX */
+ "#cccccc",
+ "#555555",
++ "black",
++ "gray90",
+ };
+
+
+_AT_@ -127,9 +129,10 @@ static const char *colorname[] = {
+ * Default colors (colorname index)
+ * foreground, background, cursor, reverse cursor
+ */
+-unsigned int defaultfg = 7;
+-unsigned int defaultbg = 0;
+-static unsigned int defaultcs = 256;
++
++unsigned int defaultbg = 258;
++unsigned int defaultfg = 259;
++unsigned int defaultcs = 256;
+ static unsigned int defaultrcs = 257;
+
+ /*
+diff --git a/st.c b/st.c
+index abbbe4b..6a57d89 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -1877,6 +1877,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
", 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
", 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
", p);
++ else
++ redraw();
++ break;
+ case 4: /* color set */
+ if (narg < 3)
+ break;
+diff --git a/st.h b/st.h
+index 3d351b6..054366d 100644
+--- a/st.h
++++ b/st.h
+_AT_@ -123,3 +123,4 @@ extern char *termname;
+ extern unsigned int tabspaces;
+ extern unsigned int defaultfg;
+ extern unsigned int defaultbg;
++extern unsigned int defaultcs;
+--
+2.20.1
+
Received on Sun Jan 17 2021 - 00:36:50 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 17 2021 - 00:36:56 CET