summaryrefslogtreecommitdiff
path: root/st/patches/st-externalpipe-signal-0.8.2.diff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-08 15:21:28 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-08 15:21:28 +0900
commit4437d5b3c3eea76f6e2b0fd4a2ba21c02a098aeb (patch)
treee8dcb20bf144aacf88f93b012dccacdeb08015cd /st/patches/st-externalpipe-signal-0.8.2.diff
parentc2b06f0d5795a789f4ddab459179ff89aedfee98 (diff)
updates
Diffstat (limited to 'st/patches/st-externalpipe-signal-0.8.2.diff')
-rw-r--r--st/patches/st-externalpipe-signal-0.8.2.diff74
1 files changed, 74 insertions, 0 deletions
diff --git a/st/patches/st-externalpipe-signal-0.8.2.diff b/st/patches/st-externalpipe-signal-0.8.2.diff
new file mode 100644
index 0000000..c573d51
--- /dev/null
+++ b/st/patches/st-externalpipe-signal-0.8.2.diff
@@ -0,0 +1,74 @@
+From df32a82e8a889629ed406ce468f24c35da7e9a03 Mon Sep 17 00:00:00 2001
+From: Miles Alan <m@milesalan.com>
+Date: Sun, 11 Aug 2019 21:33:55 -0500
+Subject: [PATCH] Add handler for SIGUSR1 signal to run an externalpipe command
+
+---
+ config.def.h | 1 +
+ st.c | 14 ++++++++++++++
+ st.h | 1 +
+ 3 files changed, 16 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 0e01717..96d1bdd 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -1,3 +1,4 @@
++char *externalpipe_sigusr1[] = {"/bin/sh", "-c", "externalpipe_buffer.sh st_strings_read"};
+ /* See LICENSE file for copyright and license details. */
+
+ /*
+diff --git a/st.c b/st.c
+index b8e6077..48cae2e 100644
+--- a/st.c
++++ b/st.c
+@@ -155,6 +155,7 @@ typedef struct {
+ static void execsh(char *, char **);
+ static void stty(char **);
+ static void sigchld(int);
++static void sigusr1(int);
+ static void ttywriteraw(const char *, size_t);
+
+ static void csidump(void);
+@@ -719,6 +720,13 @@ execsh(char *cmd, char **args)
+ _exit(1);
+ }
+
++void
++sigusr1(int unused)
++{
++ static Arg a = {.v = externalpipe_sigusr1};
++ externalpipe(&a);
++}
++
+ void
+ sigchld(int a)
+ {
+@@ -765,6 +773,12 @@ stty(char **args)
+ int
+ ttynew(char *line, char *cmd, char *out, char **args)
+ {
++ static struct sigaction sa;
++ sa.sa_handler = sigusr1;
++ sigemptyset(&sa.sa_mask);
++ sa.sa_flags = SA_RESTART;
++ sigaction(SIGUSR1, &sa, NULL);
++
+ int m, s;
+
+ if (out) {
+diff --git a/st.h b/st.h
+index 38c61c4..794b4ff 100644
+--- a/st.h
++++ b/st.h
+@@ -111,6 +111,7 @@ void *xrealloc(void *, size_t);
+ char *xstrdup(char *);
+
+ /* config.h globals */
++extern char *externalpipe_sigusr1[];
+ extern char *utmp;
+ extern char *stty_args;
+ extern char *vtiden;
+--
+2.19.2
+