Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid double sending of SIGINT to subprocesses
Standard bash behavior when pressing Ctrl+C is to send SIGINT to the foreground process group. This combines well with standard fork behavior because subprocesses are started in the same group, so a multi-process program is correctly terminated without any explicit signal handling. It however does not work well in cases where signals are handled explicitly like here, because on Ctrl+C the subprocesses receive two SIGINTs - one directly from the shell and one from the interrupt handler in the `CLI` class. This in turn can prevent graceful shutdown in the subprocesses. The specific example that prompted this fix was interrupting feature specs using selenium. In case of a double interrupt the browser process will sometimes remain running after rspec is terminated.
- Loading branch information