feat(tui): ctrl+c quit confirmation and /new fresh-session command - #59
Merged
Conversation
The first ^C arms the standard confirm gate (y or a second ^C fires, any other key disarms and is consumed); all 11 quit sites now route through armConfirm(confirmQuit) instead of quitting outright, and the gate renders from the top of footer() so it is visible from every context that can arm it — panels, overlays, approvals, composer.
/clear only wipes the local view — the session kept accumulating history and context server-side. odek binds sessions per connection and mints a new one on a sessionless connection's first prompt, so /new drops the session identity and closes the socket: the standard reconnect lands sessionless and the next prompt starts a genuinely new session. The old one stays resumable via /sessions. Idle-only like /clear, plus guards for pending approvals and queued prompts — both would be destroyed by the forced redial.
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
Two session-lifecycle features:
1. Ctrl+C quit confirmation
The first ^C arms the standard two-step confirm gate —
yor a second ^C fires, any other key disarms (and is consumed, never typed). All 11 quit sites now route througharmConfirm(confirmQuit)instead of quitting outright; the gate renders at the top offooter()so it is visible from every context that can arm it./quitstays immediate (explicit typed intent).2.
/new— start a fresh session/clearonly wipes the local view; the session kept accumulating history and context server-side. Verified against odek's protocol: sessions bind per WebSocket connection, and a sessionless connection's first prompt mints a brand-new session. So/newdrops the session identity and closes the socket — the standard reconnect lands sessionless and the next prompt starts a genuinely new session (new ID, empty history/buffer). The old session stays resumable via/sessions.Guards: idle-only (like
/clear), plus pending approvals and queued prompts — both would be destroyed by the forced redial.Test plan
quit_confirm_test.go(5 tests + 8-context matrix) andnew_session_test.go(guards, reset, reconnect-lands-fresh)/newe2e case added toTestE2EAllCommands(registry completeness guard)make fmt vet lint test— lint 0 issues, all packages green under-race