What this thread does
Our recommendation: match the clipboard utility to X11 or Wayland, then distinguish the system clipboard from primary selection. Do first (our recommendation): follow OpenCode’s V1 Linux utility checklist before applying a tmux workaround.
The problem
The issue reports selecting text in OpenCode's terminal UI, seeing a copied message, then pasting nothing or an older clip. The GitHub issue was opened by maheshmuttintidev on 2025-11-13 (OpenCode 1.0.62, Ubuntu 24.04).
What a contributor said
A contributor (kommander) said OpenCode copied to the local clipboard and sent OSC52 for SSH; he said OSC52 seemed broken and it should not do both by default. In an earlier comment, he proposed a generalized copyToClipboard helper in opentui. He also said that over SSH the terminal itself must support OSC52.
Fixes commenters reported
The official V1 troubleshooting guide names xclip or xsel for X11 and wl-clipboard for Wayland. The guide says OpenCode detects Wayland and prefers wl-clipboard; otherwise it looks for xclip, then xsel. The tmux and remote-session items below remain commenter reports:
- Local X11 desktop: install
xclip(sudo apt install xclip). One commenter on Linux Mint reported success, and others confirmed on Ubuntu 24.04; one added restarting the terminal session afterwards. One commenter installedxseland could paste after holding Shift while selecting; they had not tried withoutxseland were unsure it mattered. - Wayland: a Manjaro user said installing
wl-clipboardseemed to fix the issue. - Over SSH inside tmux: add
set -g allow-passthrough onto your tmux config, then reload or restart tmux. Commenters reported success with this setting in Arch over SSH to a VM and in Ubuntu with tmux; one macOS commenter said only the tmux setting was necessary. One commenter using remote SSH reported trying xclip installation and the tmux setting together. - Reported selection workarounds: one commenter said Shift-mouse selection worked for them in many terminals; another reported selecting and copying through tmux scroll mode in code-server.
What did not work for everyone
- One commenter said the xclip suggestion did not work in remote/web VS Code; a different commenter reported success with tmux scroll mode in code-server.
- A headless server user tried xclip and a virtual display with no luck.
- A commenter said copying often failed while the agent was busy, might work when idle, and could be partial for long selections.
Status
A project member closed the issue on 2026-10-11 as not planned, saying development focused on OpenCode 2.0 and they were closing issues filed against OpenCode 1, asking people to retry on 2.0. Commenters on 2.0.27 and 2.0.28 on 12 and 13 October said it still happens, so closure did not establish a universal 2.0 fix. On 18 October, sbgraphic also reported selection trouble in the VS Code terminal on 2.0.32. On 23 October, contributor donbowman distinguished Unix selection buffers from the clipboard and described a proposed v2 change to double-click behavior. Shift-selection can target the primary selection buffer, so middle-click and clipboard paste need not contain the same text; a commenter also warns that multiline selection can include the sidebar. Later discussion.
Caveats
Our recommendation: choose which reported workaround to try based on your display server, terminal and tmux setup. One commenter said the TUI did not warn about a missing dependency. Our recommendation: review each package before installing it.
Sources
- OpenCode Linux copy/paste troubleshooting: X11 and Wayland utilities and detection order.
- Issue 4283: OSC52 and tmux reports, closure during the 2.0 sweep, later 2.0.32 reports and the October selection-buffer discussion.
Started from a post by @maheshmuttintidev, packaged by the editor. Original post