Skip to content
Closed
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
14 changes: 12 additions & 2 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6482,7 +6482,12 @@ def _pick():
self._status_bar_visible = False
self._app.invalidate()
try:
run_in_terminal(_pick)
_future = run_in_terminal(_pick)
# run_in_terminal returns an Awaitable/Future in prompt_toolkit 3.0+.
# Block until it completes so the coroutine isn't orphaned.
_done = threading.Event()
_future.add_done_callback(lambda f: _done.set())
_done.wait(timeout=60)
finally:
self._status_bar_visible = was_visible
self._app.invalidate()
Expand Down Expand Up @@ -6519,7 +6524,12 @@ def _ask():
self._status_bar_visible = False
self._app.invalidate()
try:
run_in_terminal(_ask)
_future = run_in_terminal(_ask)
# run_in_terminal returns an Awaitable/Future in prompt_toolkit 3.0+.
# Block until it completes so the coroutine isn't orphaned.
_done = threading.Event()
_future.add_done_callback(lambda f: _done.set())
_done.wait(timeout=60)
except Exception:
# WSL / Warp / certain terminal emulators silently drop the
# scheduled coroutine. Fall back to a direct input() so the
Expand Down