| 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(-)
--- |
| @@ -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 * |