aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/vis.c b/vis.c
index b7619fe..c8a102b 100644
--- a/vis.c
+++ b/vis.c
@@ -994,6 +994,14 @@ bool vis_signal_handler(Vis *vis, int signum, const siginfo_t *siginfo, const vo
case SIGINT:
vis->cancel_filter = true;
return true;
+ case SIGCONT:
+ case SIGWINCH:
+ vis->need_resize = true;
+ return true;
+ case SIGTERM:
+ case SIGHUP:
+ vis->terminate = true;
+ return true;
}
return false;
}
@@ -1037,6 +1045,14 @@ int vis_run(Vis *vis, int argc, char *argv[]) {
free(name);
}
+ if (vis->terminate)
+ vis_die(vis, "Killed by SIGTERM\n");
+
+ if (vis->need_resize) {
+ vis->ui->resize(vis->ui);
+ vis->need_resize = false;
+ }
+
vis_update(vis);
idle.tv_sec = vis->mode->idle_timeout;
int r = pselect(1, &fds, NULL, NULL, timeout, &emptyset);