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>
This commit is contained in:
Lukas Fleischer
2021-04-04 11:53:53 -04:00
parent 193ad3415a
commit 5398f3a24e
7 changed files with 19 additions and 12 deletions

View File

@@ -158,7 +158,7 @@ void ui_todo_pipe(void)
return;
wins_prepare_external();
if ((pid = shell_exec(NULL, &pout, NULL, *arg, arg))) {
if ((pid = shell_exec(NULL, &pout, NULL, 0, *arg, arg))) {
fpout = fdopen(pout, "w");
todo_write(item, fpout);
fclose(fpout);