aboutsummaryrefslogtreecommitdiffstats
path: root/src/hooks.c
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2021-04-04 11:53:53 -0400
committerLukas Fleischer <lfleischer@calcurse.org>2021-04-04 12:15:31 -0400
commit5398f3a24e988da4836f78fba62acf2ead1030b0 (patch)
treea580b9b1ad611eaab723c8b62172bbe801578a1a /src/hooks.c
parent193ad3415a0e76bf046bfcc3f03dd65742f18589 (diff)
downloadcalcurse-5398f3a24e988da4836f78fba62acf2ead1030b0.tar.gz
calcurse-5398f3a24e988da4836f78fba62acf2ead1030b0.zip
Call setsid() for hook/notification commands
We do not want hook or notification commands to interact with the terminal in any way. Create a new session for them. Addresses GitHub issue #326. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/hooks.c')
-rw-r--r--src/hooks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hooks.c b/src/hooks.c
index 35d8a1a..7bfd548 100644
--- a/src/hooks.c
+++ b/src/hooks.c
@@ -51,7 +51,7 @@ int run_hook(const char *name)
arg[0] = hook_path;
arg[1] = NULL;
- if ((pid = shell_exec(&pin, &pout, &perr, *arg, arg))) {
+ if ((pid = shell_exec(&pin, &pout, &perr, 1, *arg, arg))) {
ret = child_wait(&pin, &pout, &perr, pid);
if (ret > 0 && WIFEXITED(ret)) {
asprintf(&mesg, "%s hook: exit status %d",