Show More
@@ -10,6 +10,7 b' import warnings' | |||||
10 | import signal |
|
10 | import signal | |
11 | import sys |
|
11 | import sys | |
12 | import re |
|
12 | import re | |
|
13 | import os | |||
13 | from typing import Callable |
|
14 | from typing import Callable | |
14 |
|
15 | |||
15 |
|
16 | |||
@@ -56,7 +57,7 b' def create_ipython_shortcuts(shell):' | |||||
56 | & insert_mode |
|
57 | & insert_mode | |
57 | ))(reformat_and_execute) |
|
58 | ))(reformat_and_execute) | |
58 |
|
59 | |||
59 |
kb.add( |
|
60 | kb.add("c-\\")(quit) | |
60 |
|
61 | |||
61 | kb.add('c-p', filter=(vi_insert_mode & has_focus(DEFAULT_BUFFER)) |
|
62 | kb.add('c-p', filter=(vi_insert_mode & has_focus(DEFAULT_BUFFER)) | |
62 | )(previous_history_or_previous_completion) |
|
63 | )(previous_history_or_previous_completion) | |
@@ -458,11 +459,16 b' def reset_search_buffer(event):' | |||||
458 | def suspend_to_bg(event): |
|
459 | def suspend_to_bg(event): | |
459 | event.app.suspend_to_background() |
|
460 | event.app.suspend_to_background() | |
460 |
|
461 | |||
461 |
def |
|
462 | def quit(event): | |
462 | """ |
|
463 | """ | |
463 | Force exit (with a non-zero return value) |
|
464 | On platforms that support SIGQUIT, send SIGQUIT to the current process. | |
|
465 | On other platforms, just exit the process with a message. | |||
464 | """ |
|
466 | """ | |
465 | sys.exit("Quit") |
|
467 | sigquit = getattr(signal, "SIGQUIT", None) | |
|
468 | if sigquit is not None: | |||
|
469 | os.kill(0, signal.SIGQUIT) | |||
|
470 | else: | |||
|
471 | sys.exit("Quit") | |||
466 |
|
472 | |||
467 | def indent_buffer(event): |
|
473 | def indent_buffer(event): | |
468 | event.current_buffer.insert_text(' ' * 4) |
|
474 | event.current_buffer.insert_text(' ' * 4) |
General Comments 0
You need to be logged in to leave comments.
Login now