From 89a177cd9aaa10623dca452f358fc967ccb83561 Mon Sep 17 00:00:00 2001 From: Jonathan Slenders Date: Tue, 8 Mar 2022 00:37:22 +0100 Subject: [PATCH] Don't handle sigint when prompting for input. Fixes: https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1576 --- IPython/terminal/interactiveshell.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 400152ad754..671229b2b96 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -610,6 +610,9 @@ def prompt_for_code(self): with patch_stdout(raw=True): text = self.pt_app.prompt( default=default, + # Don't set sigint signal handlers. + # See: https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1576 + handle_sigint=False, **self._extra_prompt_options()) finally: # Restore the original event loop.