Unable to copy terminal output to clipboard on macOS #4329

Open
opened 2026-02-16 17:43:27 -05:00 by yindo · 7 comments
Owner

Originally created by @teddy-paris on GitHub (Jan 6, 2026).

Originally assigned to: @kommander on GitHub.

Problem

When using OpenCode's integrated terminal, users cannot copy text from the terminal output using Cmd+C on macOS. The keyboard shortcut appears to be intercepted by the TUI before it reaches the system clipboard.

Expected Behavior

Users should be able to select text in the integrated terminal and copy it to the clipboard using standard macOS shortcuts (Cmd+C), so they can paste it into the chat input or other applications.

Current Behavior

Pressing Cmd+C after selecting text in the integrated terminal does nothing - the text is not copied to the clipboard.

Environment

  • macOS
  • OpenCode TUI with integrated terminal

Suggested Solutions

  1. Pass through Cmd+C to the system when text is selected in the terminal
  2. Add a right-click context menu with "Copy" option
  3. Add a keybind specifically for terminal copy (e.g., Cmd+Shift+C)

Use Case

Users often need to copy error messages, file paths, or command output from the terminal to paste into the chat for context or to reference in their queries.

Originally created by @teddy-paris on GitHub (Jan 6, 2026). Originally assigned to: @kommander on GitHub. ## Problem When using OpenCode's integrated terminal, users cannot copy text from the terminal output using `Cmd+C` on macOS. The keyboard shortcut appears to be intercepted by the TUI before it reaches the system clipboard. ## Expected Behavior Users should be able to select text in the integrated terminal and copy it to the clipboard using standard macOS shortcuts (`Cmd+C`), so they can paste it into the chat input or other applications. ## Current Behavior Pressing `Cmd+C` after selecting text in the integrated terminal does nothing - the text is not copied to the clipboard. ## Environment - macOS - OpenCode TUI with integrated terminal ## Suggested Solutions 1. Pass through `Cmd+C` to the system when text is selected in the terminal 2. Add a right-click context menu with "Copy" option 3. Add a keybind specifically for terminal copy (e.g., `Cmd+Shift+C`) ## Use Case Users often need to copy error messages, file paths, or command output from the terminal to paste into the chat for context or to reference in their queries.
yindo added the opentui label 2026-02-16 17:43:27 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 6, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #7132: Unable to copy terminal output to clipboard on macOS

Feel free to ignore if none of these address your specific case.

For keybind-related issues, please also check our pinned keybinds documentation: #4997

@github-actions[bot] commented on GitHub (Jan 6, 2026): This issue might be a duplicate of existing issues. Please check: - #7132: Unable to copy terminal output to clipboard on macOS Feel free to ignore if none of these address your specific case. For keybind-related issues, please also check our pinned keybinds documentation: #4997
Author
Owner

@kommander commented on GitHub (Jan 6, 2026):

What integrated terminal? Are you using a fork? Opencode does not yet have an integrated terminal officially. From the TUI itself select should automatically copy the selected text on mouse button release currently. There are too many conflicting keybindings that would make it impossible to use the OS defaults, also their capture is not supported by all terminals.

@kommander commented on GitHub (Jan 6, 2026): What integrated terminal? Are you using a fork? Opencode does not yet have an integrated terminal officially. From the TUI itself select should automatically copy the selected text on mouse button release currently. There are too many conflicting keybindings that would make it impossible to use the OS defaults, also their capture is not supported by all terminals.
Author
Owner

@ErvisTusha commented on GitHub (Jan 7, 2026):

I can confirm this issue also occurs on Ubuntu with the default terminal. Running OpenCode v1.1.4, I am able to select text and receive a copy confirmation notification, however the text is not actually copied to the clipboard.

@ErvisTusha commented on GitHub (Jan 7, 2026): I can confirm this issue also occurs on Ubuntu with the default terminal. Running OpenCode v1.1.4, I am able to select text and receive a copy confirmation notification, however the text is not actually copied to the clipboard.
Author
Owner

@ErvisTusha commented on GitHub (Jan 7, 2026):

I've created a pull request (#7220) to fix the clipboard error handling issue. This PR enhances the clipboard functionality across all platforms with improved error propagation and exit code checking.

The changes include:

  • Better error handling for Linux clipboard tools (wl-copy, xclip, xsel)
    • Proper detection and handling of Wayland vs X11 environments
      • Clear error messages when tools are missing
@ErvisTusha commented on GitHub (Jan 7, 2026): I've created a pull request (#7220) to fix the clipboard error handling issue. This PR enhances the clipboard functionality across all platforms with improved error propagation and exit code checking. The changes include: - Better error handling for Linux clipboard tools (wl-copy, xclip, xsel) - - Proper detection and handling of Wayland vs X11 environments - - - Clear error messages when tools are missing - - - - User-friendly error notifications when clipboard operations fail Please feel free to review the PR at: https://github.com/anomalyco/opencode/pull/7220
Author
Owner

@ErvisTusha commented on GitHub (Jan 7, 2026):

fixed for 1.1.6

@ErvisTusha commented on GitHub (Jan 7, 2026): fixed for 1.1.6
Author
Owner

@skhaz commented on GitHub (Jan 8, 2026):

I have the same issue on iterm2.

It do not allow me to use cmd+c to copy, instead, it copies when I select any text /facepalm.

@skhaz commented on GitHub (Jan 8, 2026): I have the same issue on iterm2. It do not allow me to use cmd+c to copy, instead, it copies when I select any text /facepalm.
Author
Owner

@gardner commented on GitHub (Feb 6, 2026):

The copy / paste hijacking really makes it hard to use opencode.

@gardner commented on GitHub (Feb 6, 2026): The copy / paste hijacking really makes it hard to use opencode.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4329