##// END OF EJS Templates
ControlZ should suspend IPython to the background.
Jonathan Slenders -
Show More
@@ -3,6 +3,7 b' from __future__ import print_function'
3
3
4 import os
4 import os
5 import sys
5 import sys
6 import signal
6
7
7 from IPython.core.interactiveshell import InteractiveShell
8 from IPython.core.interactiveshell import InteractiveShell
8 from IPython.utils.py3compat import PY3, cast_unicode_py2, input
9 from IPython.utils.py3compat import PY3, cast_unicode_py2, input
@@ -136,6 +137,12 b' class TerminalInteractiveShell(InteractiveShell):'
136 def _(event):
137 def _(event):
137 event.current_buffer.reset()
138 event.current_buffer.reset()
138
139
140 supports_suspend = Condition(lambda cli: hasattr(signal, 'SIGTSTP'))
141
142 @kbmanager.registry.add_binding(Keys.ControlZ, filter=supports_suspend)
143 def _(event):
144 event.cli.suspend_to_background()
145
139 @Condition
146 @Condition
140 def cursor_in_leading_ws(cli):
147 def cursor_in_leading_ws(cli):
141 before = cli.application.buffer.document.current_line_before_cursor
148 before = cli.application.buffer.document.current_line_before_cursor
General Comments 0
You need to be logged in to leave comments. Login now