-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Describe the bug
Since v0.0.413, alt-screen mode is enabled by default for users running with the --experimental flag. This causes Cmd+C text copy to stop working on macOS because the TUI's mouse reporting captures mouse drag events, preventing the terminal emulator from performing native text selection.
Before v0.0.413, alt-screen was opt-in, and Cmd+C worked normally for copying text. After the update, there is nothing to copy because text selection is intercepted by the TUI.
The relevant changelog entry from v0.0.413:
Enable alt-screen mode by default when running with
--experimentalflag
v0.0.414 added Ctrl+Insert for copying selected text in alt-screen, but this is not a standard macOS shortcut — most Mac keyboards do not have an Insert key.
Steps to reproduce the behavior
- Run
copilotwith--experimentalflag enabled (or with experimental features turned on in config) - Have Copilot generate some output
- Try to select text with the mouse and press Cmd+C to copy
- Text selection is captured by the TUI mouse reporting — nothing gets copied to clipboard
Expected behavior
Cmd+C should copy selected text to the system clipboard, consistent with macOS conventions. Possible solutions:
- Support Cmd+C as a native copy shortcut within the alt-screen TUI (macOS)
- Use OSC 52 escape sequences to programmatically write selections to the system clipboard
- Add a config option to disable mouse reporting so native terminal selection works
- Reconsider making alt-screen the default for
--experimentalusers, or at least document the copy behavior change
Workaround
- Hold Shift (or Option in iTerm2) while dragging to bypass mouse reporting, then Cmd+C works
- Run
copilot --no-alt-screento disable alt-screen mode - Use
Ctrl+Insertto copy (v0.0.414+, but impractical on Mac keyboards)
Affected version
v0.0.413 ~ v0.0.414 (current)
Additional context
- OS: macOS (Apple Silicon)
- Copilot CLI version: 0.0.414
- Config: experimental features enabled, staff mode enabled
- The issue affects all macOS terminal emulators (Terminal.app, iTerm2, Ghostty, Kitty, etc.) since mouse reporting is handled at the TUI level before the terminal can process selections