You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the past it worked to select a piece of text to copy it into the clipboard. It still shows the message that the text was copied, but it never actually gets copied into the clipboard. I noticed this first around 1-2 weeks ago and hoped it would get fixed, but it didn't
After selecting, my version no longer automatically copies, which I really like. The automatic deselection and copy function was so annoying.
Because after selecting text, I might not want to copy it but rather use shortcuts for tasks like translation.
But now, after selecting text, I can only copy using the right mouse button, and can't use command+c, which is also very annoying.
Hi, thanks for the report. Linux copy can depend on tools like wl-copy, xclip, or xsel, and the app may currently show the success toast even when the underlying clipboard backend fails.
Could you help check your environment and share the results?
Are any clipboard tools available?
command -v wl-copy
command -v wl-paste
command -v xclip
command -v xsel
It looks like your environment may be missing a clipboard tool that opencode can use on Linux.
Could you first confirm which desktop session you're running?
echo $XDG_SESSION_TYPE
Then install the matching clipboard tool:
If it prints x11:
sudo apt install xclip
If it prints wayland:
sudo apt install wl-clipboard
After installing, please restart the terminal and try again.
This should resolve the issue in most cases, since on Linux the TUI copy flow depends on an available clipboard backend such as xclip or wl-copy.
Reacted by William Swanson, Ryen, bibitoo, Ayake, MD and laeo
@AbigailJixiangyuyu I don't understand why gnome-terminal can copy and paste text without wl-clipboard in wayland but opencode cannot. Isn't there a more native way to support it without additional packages?
On macOS this likely is not a missing dependency issue.
The current TUI clipboard path uses osascript, and it looks like failures from that command may currently be treated as success, which would explain why the UI shows Copied to clipboard even when the clipboard does not actually change.
Sorry, I do not have a macOS environment available, so I cannot help investigate this any further from my side.
@AbigailJixiangyuyu I don't understand why gnome-terminal can copy and paste text without wl-clipboard in wayland but opencode cannot. Isn't there a more native way to support it without additional packages?
I guess the reason is that gnome-terminal can copy because it is the terminal emulator itself and has direct access to the desktop clipboard. However, opencode runs as a child process inside the terminal, so it does not automatically get the same access. What's more, the code already tries the terminal-native route via OSC 52, then falls back to wl-copy / xclip / xsel.
I guess the reason is that gnome-terminal can copy because it is the terminal emulator itself and has direct access to the desktop clipboard. However, opencode runs as a child process inside the terminal, so it does not automatically get the same access. What's more, the code already tries the terminal-native route via OSC 52, then falls back to wl-copy / xclip / xsel.
@AbigailJixiangyuyu are you saying there's no way to use the terminal-native route because opencode runs as a child process? Are you saying that wl-copy is the only way to get this working in this case? Thanks.
wigy-opensource-developer commented on Mar 19, 2026
The underlying issue is that there is no error message like "Hey, I wanted to copy to clipboard, but you are missing some system package for it. I wanted to use xclip, this is how you install it."
Terminal: GNOME Terminal server (gnome-terminal-server) embedded in Electron app
OpenCode Version: 1.14.33
Bug Description:
Copy via text selection shows "copied to clipboard" notification but the content is not available when pasting. Neither Ctrl+Shift+V nor middle-click (mouse scroll wheel) paste work. The clipboard appears to be completely non-functional on Wayland.
What doesn't work:
Ctrl+Shift+C / Ctrl+Shift+V — shows "copied" but content unavailable
Middle-click paste — does not paste anything
Copy/paste between opencode and external applications
Additional context:
This is a complete clipboard failure, not just a cross-session issue. Regression on Wayland. Multiple related issues filed (#17796, #17858, #13984). Electron + Wayland + GNOME known to have clipboard problems.
No properly behaving terminal application depends on external tools for text selection and copy. On X11 no-one even needs to "copy" as selected text is immediately available for being pasted. opencode is completely broken, does not work over remote session, inside container etc. It generally is misbehaving application that damages your terminal and should be avoided.
Closing as a duplicate of #4283, which tracks copy to clipboard not working in the TUI (it shows "copied", but nothing reaches the clipboard). Please add your OS, terminal and OpenCode version there.
Activity
github-actions commentedon Mar 16, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is the same as one of the above, please comment there instead so efforts can be consolidated.
tlerbao commentedon Mar 16, 2026
After selecting, my version no longer automatically copies, which I really like. The automatic deselection and copy function was so annoying.
Because after selecting text, I might not want to copy it but rather use shortcuts for tasks like translation.
But now, after selecting text, I can only copy using the right mouse button, and can't use command+c, which is also very annoying.
AbigailJixiangyuyu commentedon Mar 16, 2026
Hi, thanks for the report. Linux copy can depend on tools like wl-copy, xclip, or xsel, and the app may currently show the success toast even when the underlying clipboard backend fails.
Could you help check your environment and share the results?
Are any clipboard tools available?
command -v wl-copy
command -v wl-paste
command -v xclip
command -v xsel
tlerbao commentedon Mar 16, 2026
No output
AbigailJixiangyuyu commentedon Mar 16, 2026
Are you running this inside a Linux desktop session (GUI), or in a non-graphical environment such as SSH/TTY/headless server?
AbigailJixiangyuyu commentedon Mar 16, 2026
It looks like your environment may be missing a clipboard tool that opencode can use on Linux.
Could you first confirm which desktop session you're running?
echo $XDG_SESSION_TYPE
Then install the matching clipboard tool:
sudo apt install xclip
sudo apt install wl-clipboard
After installing, please restart the terminal and try again.
This should resolve the issue in most cases, since on Linux the TUI copy flow depends on an available clipboard backend such as xclip or wl-copy.
tlerbao commentedon Mar 16, 2026
@AbigailJixiangyuyu I am macOS 13,
xmready commentedon Mar 16, 2026
#17858
@AbigailJixiangyuyu I don't understand why gnome-terminal can copy and paste text without
wl-clipboardin wayland but opencode cannot. Isn't there a more native way to support it without additional packages?AbigailJixiangyuyu commentedon Mar 17, 2026
On macOS this likely is not a missing dependency issue.
The current TUI clipboard path uses osascript, and it looks like failures from that command may currently be treated as success, which would explain why the UI shows Copied to clipboard even when the clipboard does not actually change.
Sorry, I do not have a macOS environment available, so I cannot help investigate this any further from my side.
AbigailJixiangyuyu commentedon Mar 17, 2026
I guess the reason is that gnome-terminal can copy because it is the terminal emulator itself and has direct access to the desktop clipboard. However, opencode runs as a child process inside the terminal, so it does not automatically get the same access. What's more, the code already tries the terminal-native route via OSC 52, then falls back to wl-copy / xclip / xsel.
xmready commentedon Mar 18, 2026
@AbigailJixiangyuyu are you saying there's no way to use the terminal-native route because opencode runs as a child process? Are you saying that
wl-copyis the only way to get this working in this case? Thanks.wigy-opensource-developer commentedon Mar 19, 2026
The underlying issue is that there is no error message like "Hey, I wanted to copy to clipboard, but you are missing some system package for it. I wanted to use xclip, this is how you install it."
aceroraas commentedon May 4, 2026
Environment:
Bug Description:
Copy via text selection shows "copied to clipboard" notification but the content is not available when pasting. Neither Ctrl+Shift+V nor middle-click (mouse scroll wheel) paste work. The clipboard appears to be completely non-functional on Wayland.
What doesn't work:
Additional context:
This is a complete clipboard failure, not just a cross-session issue. Regression on Wayland. Multiple related issues filed (#17796, #17858, #13984). Electron + Wayland + GNOME known to have clipboard problems.
emsi commentedon May 8, 2026
No properly behaving terminal application depends on external tools for text selection and copy. On X11 no-one even needs to "copy" as selected text is immediately available for being pasted. opencode is completely broken, does not work over remote session, inside container etc. It generally is misbehaving application that damages your terminal and should be avoided.
GollyTicker commentedon May 27, 2026
This workaround worked for me! #17796 (comment)
mkdgs commentedon Jul 19, 2026
This workaround is also working for me.
An alternative without restarting the terminal, you can press Shift before clicking to disable auto-copy.
toxmc commentedon Aug 6, 2026
term off tui mouse and reopen opencode use ctrl+c ok
neriousy commentedon Oct 1, 2026
Closing as a duplicate of #4283, which tracks copy to clipboard not working in the TUI (it shows "copied", but nothing reaches the clipboard). Please add your OS, terminal and OpenCode version there.