From 41e6430e9033e383d3bb94f274fac7447c1ba844 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Sat, 23 Mar 2019 00:01:52 -0400 Subject: Forward SIGINT to current pipe process instead of terminating it. This is consistent with our do_shell() command, ppaged() command, and other shells. --- cmd2/utils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd2/utils.py') diff --git a/cmd2/utils.py b/cmd2/utils.py index a81a369f..e4da938d 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -404,6 +404,11 @@ class ProcReader(object): if self._proc.stderr is not None: self._err_thread.start() + def send_sigint(self) -> None: + """Send a SIGINT to the process""" + import signal + self._proc.send_signal(signal.SIGINT) + def terminate(self) -> None: """Terminate the process""" self._proc.terminate() -- cgit v1.2.1