Skip to content

Commit adf43f8

Browse files
Merge pull request #108 from Seldaek/ignore-sigint
Ignore SIGINTs to let the restarted process handle them
2 parents 1ab9842 + 9ebd68b commit adf43f8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/XdebugHandler.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ protected function restart($command)
256256
*/
257257
private function doRestart($command)
258258
{
259+
// ignore SIGINTs here so the child process can receive and handle them
260+
if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
261+
pcntl_async_signals(true);
262+
pcntl_signal(SIGINT, SIG_IGN);
263+
}
264+
259265
passthru($command, $exitCode);
260266
$this->notify(Status::INFO, 'Restarted process exited '.$exitCode);
261267

0 commit comments

Comments
 (0)