summaryrefslogtreecommitdiff
path: root/cmd2/utils.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-03-23 00:01:52 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-03-23 00:01:52 -0400
commit41e6430e9033e383d3bb94f274fac7447c1ba844 (patch)
tree205f45ab1ce97add2772dffabfe995907d6ad6d8 /cmd2/utils.py
parentb39ca95b8d7458e84a3c5aa8508a39e83bbce5ef (diff)
downloadcmd2-git-41e6430e9033e383d3bb94f274fac7447c1ba844.tar.gz
Forward SIGINT to current pipe process instead of terminating it. This is consistent
with our do_shell() command, ppaged() command, and other shells.
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r--cmd2/utils.py5
1 files changed, 5 insertions, 0 deletions
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()