fix(tui): show shutdown feedback on exit#23323
Merged
Merged
Conversation
canvrno-oai
approved these changes
May 18, 2026
Contributor
canvrno-oai
left a comment
There was a problem hiding this comment.
Reviewed and tested with text in the composer, active pets, streaming threads, and from several menus. I only saw the Shutting down... render very briefly on my device.
Contributor
Author
It should only be really visible on the situation I mentioned: for me sometimes the shutdown of app-server takes a while. Long enough to make it seem like the app is frozen. Once we have this improvement in place, I will start doing some analysis on what causes the slowness in the first place. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
Ctrl+C can take a noticeable amount of time to finish when the TUI is waiting for the app-server thread shutdown path to complete. Before this change, the UI could look like it had not accepted the shutdown request because the composer and cursor remained in their normal interactive state during that wait.
This PR makes the accepted shutdown visible immediately. It does not add an artificial sleep or change the shutdown timeout; it only draws one final feedback frame before continuing through the existing shutdown flow.
What Changed
ExitMode::ShutdownFirst, the TUI now renders shutdown feedback before awaiting the existing thread shutdown future.Shutting down...as the disabled input hint and suppresses footer content so the shutdown acknowledgement is not competing with shortcut/status text.How to Test
Ctrl+Cto request shutdown.› Shutting down..., the cursor disappears, and no footer hint is rendered below it.Shutting down...while the draft remains preserved internally until the process exits.Targeted tests:
cargo test -p codex-tui shutdown_in_progress_disables_input_and_uses_hint_without_footercargo test -p codex-tui bottom_pane::footer::tests::Local Validation Note
cargo test -p codex-tuistill aborts inapp::tests::discard_side_thread_removes_agent_navigation_entrywith a stack overflow. That same test also failed when run alone locally, and the failure appears unrelated to this shutdown feedback path.