Repository navigation
Run the Ctrl+R thread picker in a worker so it stops freezing - #96
Open
khushpal-cipher wants to merge 2 commits into
Open
khushpal-cipher wants to merge 2 commits into
khushpal-cipher wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #87.
Ctrl+Ris bound toaction_resume_thread. Textual awaits an async action inside the app's message pump, and that action waited for the thread picker to close. The pump was stuck waiting, so it never delivered the keys (Down, Enter, Escape) that would close the picker, and the picker froze./threadsalready worked because it runs from an input handler, not from a binding.The action is now a plain method that starts the picker flow in a worker (
_resume_thread). PressingCtrl+Rwhile a modal is open does nothing, so pickers don't stack./resumeand/threadscall_resume_threaddirectly, as before.I could not run this on Windows. I reproduced the freeze on Linux with Python 3.11 by pressing
Ctrl+Rin the test harness: the old code hangs there, the new code passes.Test plan
ruff format --checkandruff check(I did not runty)pytest -m "not live"(one failure,test_history_after_interrupted_turns_new_message_versus_continue, also fails on an untouchedmain)pytest -m live): not run, I have no accountTests: the existing picker test now presses the real
Ctrl+Rbinding and selects with the keyboard. A new test checks that a second press doesn't stack a picker, that Escape closes it, and thatCtrl+Ropens it again.Checklist