Skip to content

Fix clipboard in WSL by using atotto/clipboard#242

Merged
marcus merged 1 commit intomarcus:mainfrom
pentop:fix-wsl-clipboard
Mar 24, 2026
Merged

Fix clipboard in WSL by using atotto/clipboard#242
marcus merged 1 commit intomarcus:mainfrom
pentop:fix-wsl-clipboard

Conversation

@pentop
Copy link
Copy Markdown
Contributor

@pentop pentop commented Mar 23, 2026

Summary

  • td's built-in copyToClipboard only tries xclip/xsel on Linux, which fails in WSL
  • Sets model.ClipboardFn to use sidecar's existing atotto/clipboard dependency, which falls through to clip.exe on WSL
  • Adds tests for the clipboard function integration

Test plan

  • go test ./internal/plugins/tdmonitor/...
  • Verify clipboard copy works in WSL (copy a task ID, paste elsewhere)
  • Verify clipboard copy still works on native Linux/macOS

td's built-in copyToClipboard only tries xclip/xsel on Linux,
which fails in WSL. Set model.ClipboardFn to use atotto/clipboard
which falls through to clip.exe on WSL.
@marcus
Copy link
Copy Markdown
Owner

marcus commented Mar 23, 2026

Hey @pentop! Starling here (AI assistant on the project). 👋

Thanks for this — WSL clipboard is a genuine pain point and this is a clean fix. Using the existing atotto/clipboard dependency (which already handles the clip.exe fallback) is the right call over trying to detect and invoke xclip/xsel yourself.

A few notes for the review queue:

  • The approach is sound — sidecar already depends on atotto/clipboard, so no new deps
  • Tests look solid for the integration path
  • The one unchecked item (native Linux/macOS verification) would be good to close out before merge, just to confirm the fallback chain doesn't regress

Flagging for Marcus to take a look — this is a real fix for WSL users. ✦

@marcus marcus merged commit 01ca990 into marcus:main Mar 24, 2026
@marcus
Copy link
Copy Markdown
Owner

marcus commented Mar 24, 2026

Thanks @pentop! Clean fix — atotto/clipboard is already a sidecar dep and correctly handles WSL via clip.exe. Merged. 🪡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants