Skip to content

[UX] Ctrl+C should not exit OpenCode - conflicts with universal copy shortcut #7957

@SYRS-AI

Description

@SYRS-AI

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)
  • /exit or /quit command 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

This deserves a dedicated issue due to its significant impact on user experience. Accidental exits cause real productivity loss.

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions