Introduction
Introduction Statistics Contact Development Disclaimer Help
reset SIGWINCH when spawning a child program for displaying text items - sacc -…
git clone git://git.codemadness.org/sacc
Log
Files
Refs
LICENSE
---
commit 0573022ce4ceab92394c35c5701abe061f2ec35a
parent eae2a995544b2b48c3a7debcb186a00aa0c400b3
Author: Hiltjo Posthuma <[email protected]>
Date: Wed, 26 May 2021 16:18:22 +0200
reset SIGWINCH when spawning a child program for displaying text items
When opening a text item in the pager such as less and then resizing the
terminal it would garble/overwrite the terminal output because sacc was
redrawn.
Diffstat:
M sacc.c | 11 +++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/sacc.c b/sacc.c
@@ -285,10 +285,17 @@ printdir(Item *item)
static void
displaytextitem(Item *item)
{
+ struct sigaction sa;
FILE *pagerin;
int pid, wpid;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_RESTART;
+ sa.sa_handler = SIG_DFL;
+ sigaction(SIGWINCH, &sa, NULL);
+
uicleanup();
+
switch (pid = fork()) {
case -1:
diag("Couldn't fork.");
@@ -304,6 +311,10 @@ displaytextitem(Item *item)
;
}
uisetup();
+
+ sa.sa_handler = uisigwinch;
+ sigaction(SIGWINCH, &sa, NULL);
+ uisigwinch(SIGWINCH); /* force redraw */
}
static char *
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.