opencode
opencode copied to clipboard
[UX] Ctrl+C should not exit OpenCode - conflicts with universal copy shortcut
Description
Pressing Ctrl+C in OpenCode immediately exits the application. This is extremely frustrating because Ctrl+C is the universal copy shortcut on Windows (and commonly used on Linux too).
Users frequently press Ctrl+C out of habit when trying to copy text, and accidentally terminate their entire session - losing context and conversation history.
The Problem
| Shortcut | User Expectation | OpenCode Behavior |
|---|---|---|
Ctrl+C |
Copy selected text | Exits application |
This happens constantly during normal usage:
- Copying error messages to search online
- Copying code snippets from AI responses
- Copying file paths or commands
- General muscle memory from every other application
Expected Behavior
Option 1 (Recommended): Require double Ctrl+C or Ctrl+C twice within 1-2 seconds to exit
- First
Ctrl+C: Show message "Press Ctrl+C again to exit" - Second
Ctrl+C: Actually exit
Option 2: Use a different exit shortcut
Ctrl+D(common in Unix terminals for EOF/exit)Ctrl+Q(quit)/exitor/quitcommand only
Option 3: Make Ctrl+C cancel current operation only (like Claude Code)
- If AI is generating: Cancel generation
- If idle: Do nothing or show exit hint
- Never exit immediately on single Ctrl+C
Comparison with Other Tools
| Tool | Ctrl+C Behavior |
|---|---|
| Claude Code | Cancels current operation, does NOT exit |
| Cursor | Copy (normal IDE behavior) |
| VS Code | Copy |
| Most CLI tools | Interrupt current command, not exit shell |
Environment
- OS: Windows 11 (also affects Linux users)
- Terminal: Windows Terminal, PowerShell, Git Bash
Related Issues
- #7309 (mentions this issue but bundled with other requests)
- #7074 (CTRL_C_EVENT handling)
This deserves a dedicated issue due to its significant impact on user experience. Accidental exits cause real productivity loss.