Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion prompt_toolkit/application/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
)
from prompt_toolkit.utils import Event, in_main_thread

from ..utils import is_windows
from .current import get_app_session, set_app
from .run_in_terminal import in_terminal, run_in_terminal

Expand Down Expand Up @@ -659,8 +660,11 @@ async def run_async(
"""
assert not self._is_running, "Application is already running."

if not in_main_thread():
if not in_main_thread() or is_windows():
# Handling signals in other threads is not supported.
# Also on Windows, `add_signal_handler(signal.SIGINT, ...)` raises
# `NotImplementedError`.
# See: https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1553
handle_sigint = False

async def _run_async() -> _AppResult:
Expand Down