[PR #12733] fix(opencode): require double Ctrl+C to exit in TUI #14346

Open
opened 2026-02-16 18:19:09 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12733

State: open
Merged: No


Summary

  • add a dedicated TUI exit guard for exact Ctrl+C that requires a second press within 1.5s
  • apply the guard in prompt and child-session keyboard handlers so first Ctrl+C shows Press Ctrl+C again to exit
  • keep other app_exit bindings (for example Ctrl+D / <leader>q) as immediate exits
  • add focused unit tests for guard timing and key-matching behavior

Scope

Verification

  • bun run --cwd packages/opencode test test/cli/tui/exit-guard.test.ts (pass)
  • bun run --cwd packages/opencode typecheck (pass)
  • bun typecheck (pass)

Refs #12664

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12733 **State:** open **Merged:** No --- ## Summary - add a dedicated TUI exit guard for exact `Ctrl+C` that requires a second press within 1.5s - apply the guard in prompt and child-session keyboard handlers so first `Ctrl+C` shows `Press Ctrl+C again to exit` - keep other `app_exit` bindings (for example `Ctrl+D` / `<leader>q`) as immediate exits - add focused unit tests for guard timing and key-matching behavior ## Scope - Fixes #9041 - Partially addresses #12664 (`Ctrl+C`-triggered behavior) - The separate "garbling over time" path in #12664 is not resolved in this PR ## Verification - `bun run --cwd packages/opencode test test/cli/tui/exit-guard.test.ts` (pass) - `bun run --cwd packages/opencode typecheck` (pass) - `bun typecheck` (pass) Refs #12664
yindo added the pull-request label 2026-02-16 18:19:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14346