From 2cf077378449fb49fc0fc18b04c3e7b72ebe4462 Mon Sep 17 00:00:00 2001 From: ori Date: Mon, 15 Jun 2026 00:43:05 +0300 Subject: [PATCH 1/2] fix: use wl-copy for clipboard on Wayland --- src/clipboard.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clipboard.ts b/src/clipboard.ts index f05a63b..c1e3ef8 100644 --- a/src/clipboard.ts +++ b/src/clipboard.ts @@ -13,7 +13,7 @@ export function writeClipboard(text: string): void { function clipboardCmd(): [string, string[]] { if (process.platform === "darwin") return ["pbcopy", []]; if (process.platform === "win32") return ["clip.exe", []]; - // Linux: xclip is the most common. xsel and wl-copy also exist - // but async fallback chains add complexity for marginal gain. + if (process.env.WAYLAND_DISPLAY) return ["wl-copy", []]; + // X11 fallback return ["xclip", ["-selection", "clipboard"]]; } From 5b9a1383e017f9fc605e75709c3acb41710f9aa1 Mon Sep 17 00:00:00 2001 From: ori Date: Mon, 15 Jun 2026 00:43:38 +0300 Subject: [PATCH 2/2] docs: add changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4be8c2a..8e2bfc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Version ## [Unreleased] +### Fixed + +- Clipboard now uses `wl-copy` on Wayland instead of `xclip`, which doesn't work there. + ## [0.14.0] — 2026-06-13 ### Added