Skip to content

feat: conventional layered Ctrl+C handling in TUI - #7

Merged
qiankunli merged 1 commit into
mainfrom
feat/ctrl-c-convention
Jul 9, 2026
Merged

feat: conventional layered Ctrl+C handling in TUI#7
qiankunli merged 1 commit into
mainfrom
feat/ctrl-c-convention

Conversation

@qiankunli

Copy link
Copy Markdown
Collaborator

Ctrl+C now means 'interrupt', not 'quit', following coding-agent TUI
conventions (claude/codex behave the same way):

  • turn running → interrupt the turn (same as Esc)
  • composer has text → clear the draft
  • idle & empty → arm a 1.5s confirm window, second press exits
  • Ctrl+D on empty input exits (shell EOF convention)
  • exit paths (/exit, double Ctrl+C, Ctrl+D) now shut down gracefully:
    close both agent subprocesses before process.exit
  • renderer exitOnCtrlC disabled; layered policy lives in src/tui/keys.ts
    as a pure function with unit tests

Verified: bun run check green (70 tests, 4 new); pty smoke passes.

Ctrl+C now means 'interrupt', not 'quit', following coding-agent TUI
conventions (claude/codex behave the same way):

- turn running → interrupt the turn (same as Esc)
- composer has text → clear the draft
- idle & empty → arm a 1.5s confirm window, second press exits
- Ctrl+D on empty input exits (shell EOF convention)
- exit paths (/exit, double Ctrl+C, Ctrl+D) now shut down gracefully:
  close both agent subprocesses before process.exit
- renderer exitOnCtrlC disabled; layered policy lives in src/tui/keys.ts
  as a pure function with unit tests

Verified: bun run check green (70 tests, 4 new); pty smoke passes.
@qiankunli
qiankunli merged commit 4573d58 into main Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants