Skip to content

Commit 7f0541b

Browse files
Bugfix in invalidation of UI. Fixes an issue when the application switches to another event loop.
1 parent 129cff5 commit 7f0541b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

prompt_toolkit/application/application.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,13 @@ def flush_input() -> None:
736736
async def _run_async2() -> _AppResult:
737737
self._is_running = True
738738

739+
# Make sure to set `_invalidated` to `False` to begin with,
740+
# otherwise we're not going to paint anything. This can happen if
741+
# this application had run before on a different event loop, and a
742+
# paint was scheduled using `call_soon_threadsafe` with
743+
# `max_postpone_time`.
744+
self._invalidated = False
745+
739746
loop = get_event_loop()
740747
if set_exception_handler:
741748
previous_exc_handler = loop.get_exception_handler()

0 commit comments

Comments
 (0)