tMerge branch 'master' of git://bitreich.org/sacc - sacc - [fork] customized bu… | |
git clone git://src.adamsgaard.dk/sacc | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 1aeb110cd8997892b0579c54cf8ac064caa36b2f | |
parent 195cee5e061cad475b897bd2e1c407f753153ae7 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 8 Sep 2020 11:49:10 +0200 | |
Merge branch 'master' of git://bitreich.org/sacc | |
Diffstat: | |
M sacc.c | 10 ++++++++-- | |
M ui_ti.c | 2 ++ | |
2 files changed, 10 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/sacc.c b/sacc.c | |
t@@ -285,7 +285,7 @@ displaytextitem(Item *item) | |
return; | |
case 0: | |
parent = 0; | |
- if (!(pagerin = popen("$PAGER", "we"))) | |
+ if (!(pagerin = popen("$PAGER", "w"))) | |
_exit(1); | |
fputs(item->raw, pagerin); | |
exit(pclose(pagerin)); | |
t@@ -951,6 +951,12 @@ cleanup(void) | |
uicleanup(); | |
} | |
+void | |
+sighandler(int signo) | |
+{ | |
+ exit(128 + signo); | |
+} | |
+ | |
static void | |
setup(void) | |
{ | |
t@@ -971,7 +977,7 @@ setup(void) | |
sigemptyset(&sa.sa_mask); | |
sa.sa_flags = SA_RESTART; | |
- sa.sa_handler = exit; | |
+ sa.sa_handler = sighandler; | |
sigaction(SIGINT, &sa, NULL); | |
sigaction(SIGHUP, &sa, NULL); | |
sigaction(SIGTERM, &sa, NULL); | |
diff --git a/ui_ti.c b/ui_ti.c | |
t@@ -24,6 +24,8 @@ uisetup(void) | |
tcgetattr(0, &tsave); | |
tsacc = tsave; | |
tsacc.c_lflag &= ~(ECHO|ICANON); | |
+ tsacc.c_cc[VMIN] = 1; | |
+ tsacc.c_cc[VTIME] = 0; | |
tcsetattr(0, TCSANOW, &tsacc); | |
setupterm(NULL, 1, NULL); |