feat(tui): exit on Ctrl+D when input is empty - #60
Merged
Merged
Conversation
Fixes #58. Adds EOF-style quit (like opencode): Ctrl+D quits from chat-level focus only when there is no draft content. Non-empty input keeps tui-textarea emacs delete-forward. ConnectDialog disconnect, sessions search/item-menu, and other dialog Ctrl+D actions unchanged.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying crabcode with
|
| Latest commit: |
8babd5e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7b1fd68f.crabcode.pages.dev |
| Branch Preview URL: | https://fix-ctrl-d-exit.crabcode.pages.dev |
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.
Fixes #58.
Summary
Adds EOF-style Ctrl+D exit (like opencode) at the
App::handle_keysseam, keeping quit locality with existing double-Ctrl+C / WhichKey //exitpaths.Design (codebase-design)
handle_keysintercept alongside Ctrl+P/F/T/X, guarded toOverlayFocus::None | SuggestionsPopup.delete_next_char).input.has_draft_content()(text + image + paste placeholders), mirroring submit-time!text.is_empty() || !images.is_empty(), so attachments are not lost on quit.Input::handle_event(shallow, spreads app lifecycle into input module).Tests
app::testsregressions via existinghandle_keysinterface:ctrl_d_quits_when_input_emptyctrl_d_does_not_quit_when_input_has_text(preserves delete-forward)ctrl_d_does_not_quit_when_connect_dialog_focusedctrl_d_does_not_quit_when_sessions_dialog_focusedctrl_d_quits_when_suggestions_popup_open_and_input_emptycargo test ctrl_d: 6 passed (5 new + existing sessions search guard)cargo test app::tests: 169 passedcargo test sessions_dialog: 37 passed;connect_dialog: 2 passed;input: 106 passedcargo fmt --allclean; diff is +98 lines insrc/app.rsonly.Caveats