Interrupt on Ctrl+C, quit only on a second press - #3
Merged
Conversation
Ctrl+C exited immediately, so a reflexive tap dropped the whole session. Give it the Claude-Code cadence instead: the first press interrupts the running turn (or, when idle, just arms) and the status bar shows a "^C again to exit" hint; a second press within a 2s window quits. Esc and Ctrl+C now share one interrupt(); quitting still returns tea.Quit without closing the engine (the one-ctrl+c-freeze fix). During a pending approval, Ctrl+C denies the tool (cancels the action) and arms the window rather than denying-and-quitting.
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.
What
Ctrl+Cexited immediately, so a reflexive tap dropped the whole session. This gives it the Claude-Code cadence:Ctrl+Cinterrupts it and hands the prompt back.Ctrl+Carms the exit window (nothing to cancel).Ctrl+Cwithin 2s quits.^C AGAIN TO EXIThint after a press, auto-clearing when the window lapses (a one-shot tick repaints it).Ctrl+Cdenies the tool (cancels the action) and arms the window, instead of denying-and-quitting.Notes
interrupt(). Quit still returnstea.Quitwithout closing the engine (preserving the one-ctrl+c-freeze fix).KeyCtrlCthrough our handler (raw mode disablesISIG); only an OSSIGINTtakes the framework's separate clean-exit path.quit_test.go(double-tap quits, first press arms, approval deny+arm) andstatus_test.go(hint renders when armed). Build +go vet+ suite green.