[PR #11291] fix(keybinds): remove ctrl+c from default app_exit to prevent accidental exits #13727

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

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

State: open
Merged: No


Summary

Removes Ctrl+C from the default app_exit keybind to prevent users from accidentally exiting OpenCode when trying to copy text.

Problem

Ctrl+C is the universal copy shortcut on Windows and commonly used on Linux. Users frequently press it out of habit, accidentally terminating their session and losing context/conversation history.

Changes

  • Config: Changed default app_exit from "ctrl+c,ctrl+d,<leader>q" to "ctrl+d,<leader>q"
  • Error Screen: Fixed hardcoded ctrl+c check in ErrorComponent to respect configurable keybinds

Testing

  • All 12 packages pass typecheck
  • 101 tests pass (keybind + config suites)
  • Manual testing confirms:
    • Ctrl+C no longer exits (clears input or does nothing)
    • Ctrl+D exits as expected
    • User config overrides still work (backward compatible)

Migration

Users who prefer the old behavior can restore it via config:

{
  "keybinds": {
    "app_exit": "ctrl+c,ctrl+d,<leader>q"
  }
}

Closes #7957

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11291 **State:** open **Merged:** No --- ## Summary Removes `Ctrl+C` from the default `app_exit` keybind to prevent users from accidentally exiting OpenCode when trying to copy text. ## Problem `Ctrl+C` is the universal copy shortcut on Windows and commonly used on Linux. Users frequently press it out of habit, accidentally terminating their session and losing context/conversation history. ## Changes - **Config**: Changed default `app_exit` from `"ctrl+c,ctrl+d,<leader>q"` to `"ctrl+d,<leader>q"` - **Error Screen**: Fixed hardcoded `ctrl+c` check in ErrorComponent to respect configurable keybinds ## Testing - ✅ All 12 packages pass typecheck - ✅ 101 tests pass (keybind + config suites) - ✅ Manual testing confirms: - `Ctrl+C` no longer exits (clears input or does nothing) - `Ctrl+D` exits as expected - User config overrides still work (backward compatible) ## Migration Users who prefer the old behavior can restore it via config: ```json { "keybinds": { "app_exit": "ctrl+c,ctrl+d,<leader>q" } } ``` Closes #7957
yindo added the pull-request label 2026-02-16 18:18:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13727