Skip to content

Commit 9ebd68b

Browse files
authored
Ignore SIGINTs to let the restarted process handle them
1 parent 1ab9842 commit 9ebd68b

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)