Repository navigation
Fix clipboard on Wayland systems - #941
Merged
Merged
Conversation
On Linux systems running a Wayland session, clipboard functionality could fail if both `wl-clipboard` and an X11-based tool like `xsel` were installed. The existing implementation did not prioritize the Wayland-native tool. This change addresses the issue by: - Detecting a Wayland environment via the `WAYLAND_DISPLAY` variable. - Adjusting the tool preference order to prioritize `wl-copy`. - Correcting the tool name from `wl-clipboard` to `wl-copy` to ensure it is found in the system's PATH.
Member
|
As a filthy macos user I have no way to test this atm, can you confirm this doesn't break paste? |
Contributor
Author
|
Regarding MacOS, that's okay, nobody is perfect. ;-) I updated the docs to clarify that wl-clipboard is preferred for systems running Wayland. You're right that Previously we were looking for a daniel@redhotcar:~$ which wl-clipboard
daniel@redhotcar:~$ which wl-copy
/usr/bin/wl-copy |
Member
|
thanks a ton for this, please let me know if you see any other wayland issues in opencode! |
bussard76
pushed a commit
to bussard76/openwork
that referenced
this pull request
May 12, 2026
AIALRA-0
pushed a commit
to AIALRA-0/opencode-turn-engine
that referenced
this pull request
Jun 10, 2026
Co-authored-by: Daniel Nouri <daniel@redhotcar>
meSingh
pushed a commit
to meSingh/opencode
that referenced
this pull request
Sep 6, 2026
Co-authored-by: Daniel Nouri <daniel@redhotcar>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Linux systems running a Wayland session, clipboard functionality could fail if both
wl-clipboardand an X11-based tool likexselwere installed. The existing implementation did not prioritize the Wayland-native tool.This change addresses the issue by:
WAYLAND_DISPLAYvariable.wl-copy.wl-clipboardtowl-copyto ensure it is found in the system's PATH.