File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11## 0.9.21 (TBD, 2019)
2+ * Bug Fixes
3+ * Fixed bug where pipe processes were not being stopped by Ctrl-C on Linux/Mac
24* Enhancements
35 * Added ` read_input() ` function that is used to read from stdin. Unlike the Python built-in ` input() ` , it also has
46 an argument to disable tab completion while input is being entered.
Original file line number Diff line number Diff line change @@ -520,10 +520,11 @@ def send_sigint(self) -> None:
520520 """Send a SIGINT to the process similar to if <Ctrl>+C were pressed."""
521521 import signal
522522 if sys .platform .startswith ('win' ):
523- signal_to_send = signal .CTRL_C_EVENT
523+ self . _proc . send_signal ( signal .CTRL_C_EVENT )
524524 else :
525- signal_to_send = signal .SIGINT
526- self ._proc .send_signal (signal_to_send )
525+ # Since cmd2 uses shell=True in its Popen calls, we need to send the SIGINT to
526+ # the whole process group to make sure it propagates further than the shell
527+ os .killpg (os .getpgid (self ._proc .pid ), signal .SIGINT )
527528
528529 def terminate (self ) -> None :
529530 """Terminate the process"""
You can’t perform that action at this time.
0 commit comments