This makes handle_sigint default to False See: - https://github.com/void-linux/void-packages/issues/35712 - https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1576 - https://trac.sagemath.org/ticket/33360#comment:3 diff -ur a/src/prompt_toolkit/application/application.py b/src/prompt_toolkit/application/application.py --- a/src/prompt_toolkit/application/application.py +++ b/src/prompt_toolkit/application/application.py @@ -633,7 +633,7 @@ self, pre_run: Optional[Callable[[], None]] = None, set_exception_handler: bool = True, - handle_sigint: bool = True, + handle_sigint: bool = False, slow_callback_duration: float = 0.5, ) -> _AppResult: """ @@ -858,7 +858,7 @@ self, pre_run: Optional[Callable[[], None]] = None, set_exception_handler: bool = True, - handle_sigint: bool = True, + handle_sigint: bool = False, in_thread: bool = False, ) -> _AppResult: """ diff -ur a/src/prompt_toolkit/application/dummy.py b/src/prompt_toolkit/application/dummy.py --- a/src/prompt_toolkit/application/dummy.py +++ b/src/prompt_toolkit/application/dummy.py @@ -24,7 +24,7 @@ self, pre_run: Optional[Callable[[], None]] = None, set_exception_handler: bool = True, - handle_sigint: bool = True, + handle_sigint: bool = False, in_thread: bool = False, ) -> None: raise NotImplementedError("A DummyApplication is not supposed to run.") @@ -33,7 +33,7 @@ self, pre_run: Optional[Callable[[], None]] = None, set_exception_handler: bool = True, - handle_sigint: bool = True, + handle_sigint: bool = False, slow_callback_duration: float = 0.5, ) -> None: raise NotImplementedError("A DummyApplication is not supposed to run.") diff -ur a/src/prompt_toolkit/shortcuts/prompt.py b/src/prompt_toolkit/shortcuts/prompt.py --- a/src/prompt_toolkit/shortcuts/prompt.py +++ b/src/prompt_toolkit/shortcuts/prompt.py @@ -900,7 +900,7 @@ accept_default: bool = False, pre_run: Optional[Callable[[], None]] = None, set_exception_handler: bool = True, - handle_sigint: bool = True, + handle_sigint: bool = False, in_thread: bool = False, ) -> _T: """ @@ -1135,7 +1135,7 @@ accept_default: bool = False, pre_run: Optional[Callable[[], None]] = None, set_exception_handler: bool = True, - handle_sigint: bool = True, + handle_sigint: bool = False, ) -> _T: if message is not None: