1
0
mirror of https://github.com/danog/process.git synced 2024-11-29 20:29:16 +01:00

Ignore termination signals in shell process

Fixes #36.
This commit is contained in:
Aaron Piotrowski 2019-02-25 19:38:05 -06:00
parent 974c6e2048
commit 2f79a32f04
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -79,7 +79,7 @@ final class Runner implements ProcessRunner
public function start(string $command, string $cwd = null, array $env = [], array $options = []): ProcessHandle
{
$command = \sprintf(
'{ (%s) <&3 3<&- 3>/dev/null & } 3<&0;' .
'{ (%s) <&3 3<&- 3>/dev/null & } 3<&0; trap "" INT TERM QUIT HUP;' .
'pid=$!; echo $pid >&3; wait $pid; RC=$?; echo $RC >&3; exit $RC',
$command
);