[PR #941] [MERGED] Fix clipboard on Wayland systems #9752

Closed
opened 2026-02-16 18:14:06 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/941
Author: @dnouri
Created: 7/13/2025
Status: Merged
Merged: 7/14/2025
Merged by: @adamdotdevin

Base: devHead: clipboard-wayland


📝 Commits (2)

  • 5e5e65c Fix clipboard on Wayland systems
  • 46c772d Update docs to clarify that wl-clipboard is preferred for Wayland

📊 Changes

2 files changed (+20 additions, -10 deletions)

View changed files

📝 packages/tui/internal/clipboard/clipboard_linux.go (+19 -9)
📝 packages/web/src/content/docs/docs/troubleshooting.mdx (+1 -1)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/941 **Author:** [@dnouri](https://github.com/dnouri) **Created:** 7/13/2025 **Status:** ✅ Merged **Merged:** 7/14/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `clipboard-wayland` --- ### 📝 Commits (2) - [`5e5e65c`](https://github.com/anomalyco/opencode/commit/5e5e65c19739bfcfa4289234a87cbdf4f0a3aea1) Fix clipboard on Wayland systems - [`46c772d`](https://github.com/anomalyco/opencode/commit/46c772d608510d9a284c16cfb4f35911a4d11bef) Update docs to clarify that wl-clipboard is preferred for Wayland ### 📊 Changes **2 files changed** (+20 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/tui/internal/clipboard/clipboard_linux.go` (+19 -9) 📝 `packages/web/src/content/docs/docs/troubleshooting.mdx` (+1 -1) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:06 -05:00
yindo closed this issue 2026-02-16 18:14:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9752