##// END OF EJS Templates
Have Ctrl-C in search mode clear query, if present...
Gil Forsyth -
Show More
@@ -16,7 +16,7 b' from IPython.utils.process import abbrev_cwd'
16 16 from traitlets import Bool, CBool, Unicode, Dict
17 17
18 18 from prompt_toolkit.completion import Completer, Completion
19 from prompt_toolkit.enums import DEFAULT_BUFFER
19 from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER
20 20 from prompt_toolkit.filters import HasFocus, HasSelection, Condition
21 21 from prompt_toolkit.history import InMemoryHistory
22 22 from prompt_toolkit.shortcuts import create_prompt_application, create_eventloop
@@ -182,6 +182,13 b' class TerminalInteractiveShell(InteractiveShell):'
182 182 def _(event):
183 183 event.current_buffer.reset()
184 184
185 @kbmanager.registry.add_binding(Keys.ControlC, filter=HasFocus(SEARCH_BUFFER))
186 def _(event):
187 if event.current_buffer.document.text:
188 event.current_buffer.reset()
189 else:
190 event.cli.push_focus(DEFAULT_BUFFER)
191
185 192 supports_suspend = Condition(lambda cli: hasattr(signal, 'SIGTSTP'))
186 193
187 194 @kbmanager.registry.add_binding(Keys.ControlZ, filter=supports_suspend)
General Comments 0
You need to be logged in to leave comments. Login now