Skip to content

[Bug]: macOS — Cmd+C / Ctrl+Shift+C don't copy selection inside mouse-capturing TUIs (Claude Code, etc.); only plain Ctrl+C works #9727

Closed

Description

@jisulee42

Summary

On macOS, inside a fullscreen TUI that enables mouse tracking (Claude Code, OpenCode, etc.),
drag-selecting text and pressing Cmd+C (or Ctrl+Shift+C) copies nothing.
Only plain Ctrl+C copies the selection. Cmd+C works fine for normal shell output
(non-TUI), so the problem is specific to TUIs that own the mouse.

Repro

  1. macOS, Orca terminal (v1.4.142).
  2. Run a TUI that captures the mouse, e.g. claude.
  3. Drag-select text inside the TUI (Claude Code shows its own "copied N chars to clipboard" on copy).
  4. Press Cmd+C → nothing copied. Press Ctrl+Shift+C → nothing copied.
  5. Press plain Ctrl+C → selection is copied. ✅

Root cause (from source)

  • Cmd+C / Ctrl+Shift+C are bound to the terminal.copySelection action, which copies
    xterm's native selection via pane.terminal.getSelection() and returns early when it is empty:
    • src/renderer/src/components/terminal-pane/keyboard-handlers.ts:440-457 (if (!selection) return)
  • Inside a mouse-capturing TUI, the drag never produces an xterm native selection (the TUI owns
    the mouse and renders its own selection), so getSelection() is empty → copySelection is a no-op.
  • Plain Ctrl+C works because it is routed to the PTY as ETX instead of copySelection, and the
    CLI performs its own copy-on-selection:
    • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts:914-931
    • src/renderer/src/components/terminal-pane/xterm-bypass-policy.ts:181-194
  • On macOS, Cmd+C / Cmd+V are also bypassed to the native copy path:
    • src/renderer/src/components/terminal-pane/xterm-bypass-policy.ts:248-256

Suggested fix

When the active pane's app owns the selection (mouse tracking / kitty keyboard protocol enabled)
and xterm's native getSelection() is empty, forward the copy chord to the PTY (like the plain
Ctrl+C path) instead of no-op'ing, so the CLI's own copy runs. This makes Cmd+C behave like the
working plain Ctrl+C inside TUIs, while keeping native copy for plain (non-TUI) shell selections.

Environment

  • Orca 1.4.142
  • macOS
  • TUI: Claude Code (likely affects any mouse-capturing TUI: OpenCode, etc.)

Activity

  1. added
    bug
    on Jul 27, 2026
  2. nwparker commented on Jul 27, 2026

    @nwparker
    Contributor

    Reproduction status: cannot_repro (Cmd+C in mouse-mode selection)

    Copy selection shortcuts inside mouse-mode terminal need interactive selection + clipboard. Static path for mouse protocol vs copy shortcut not isolated to a failing branch without UI.

    Need for next attempt

    Whether DECSET mouse modes are on, selection present, and which shortcut binding wins.

  3. added
    pending_repro
    on Jul 27, 2026
  4. jonas-jonas commented on Aug 14, 2026

    @jonas-jonas

    I can reproduce using Orca (Version 1.4.180 (1.4.180)) and Claude Code (v2.1.231) on MacOS. CMD+C does nothing. Ctrl+C works (seemingly because Claude Code writes to the clipboard directly.)

    The same works in Ghostty.

  5. a-c-m commented on Sep 14, 2026

    @a-c-m

    Confirmed, also happening in latest Version 1.4.201 (1.4.201) build.

  6. a-c-m commented on Sep 14, 2026

    @a-c-m

    For anyone else hitting this: It's not fixable by any config or keybinding.

    Root cause (confirmed): Orca binds CMD+C to copySelection, which reads xterm's native selection via getSelection(). When a mouse-capturing TUI like Claude Code owns the selection, getSelection() returns empty → CMD+C silently copies nothing.
    Nothing in keybindings.json, orca-data.json, or Orca settings changes this; the fix has to ship in Orca (forward the copy to the PTY when xterm's selection is empty).

    Workaround that should work today:

    • Hold ⌥ Option and drag to select, then CMD+C. Option-drag creates a native xterm selection instead of the TUI's own — so getSelection() returns text and CMD+C copies. This is the one path that sidesteps the exact bug in the issue.
  7. JGKle commented on Nov 12, 2026

    @JGKle

    The bug also happens on Linux (Orca 1.4.248, Claude Code fullscreen mode). Ctrl+Shift+C doesn't copy anything. Plain Ctrl+C works.

    It looks like the fix only went into macOS. Could Linux get the same pass-through? Ghostty does this with performable:ctrl+shift+c.

  8. added a commit that references this issue on Nov 12, 2026
    10c91a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpending_repro

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions