noice.c | 13 ++++++++++--- diff --git a/noice.c b/noice.c index 54cedef6f7cfce72c21aa418ec9fde7c74bb50d6..0420cc39c779b8c35a47d66ce13ced786272614f 100644 --- a/noice.c +++ b/noice.c @@ -427,6 +427,7 @@ char *dir; char *tmp; regex_t re; struct history *hist; + int status; redraw: nlines = MIN(LINES - 4, n); @@ -560,10 +561,16 @@ exitcurses(); /* Run program */ pid = fork(); - if (pid == 0) + if (pid == 0) { execlp(bin, bin, pathnew, NULL); - else - waitpid(pid, NULL, 0); + _exit(0); + } else { + /* Ignore interruptions */ + while (waitpid(pid, &status, + 0) == -1) + DPRINTF_D(status); + DPRINTF_D(pid); + } initcurses();