Skip to content

fix: add wl-copy support for Wayland environments#188

Open
Poukk wants to merge 1 commit intodavis7dotsh:mainfrom
Poukk:main
Open

fix: add wl-copy support for Wayland environments#188
Poukk wants to merge 1 commit intodavis7dotsh:mainfrom
Poukk:main

Conversation

@Poukk
Copy link

@Poukk Poukk commented Feb 21, 2026

Summary

  • Add Wayland clipboard support using wl-copy from wl-clipboard package
  • Detect Wayland environment via WAYLAND_DISPLAY env variable
  • Falls back to xclip/xsel if wl-copy is not available

Greptile Summary

Adds Wayland clipboard support to the CLI's clipboard utility by detecting the WAYLAND_DISPLAY environment variable and attempting wl-copy before falling back to xclip/xsel. This is a small, focused change that does not break existing clipboard behavior on macOS, Windows, WSL, or X11 Linux.

  • Adds isWayland() helper that checks process.env.WAYLAND_DISPLAY
  • Inserts wl-copy attempt in the Linux clipboard chain after WSL checks and before xclip/xsel fallback
  • Follows existing code patterns and error handling conventions
  • No plan .md files found in this PR
  • No AGENTS.md violations detected

Confidence Score: 5/5

  • This PR is safe to merge — it adds a new clipboard path without altering existing behavior.
  • The change is minimal (adding a new clipboard tool attempt in the existing fallback chain), follows established patterns, does not modify any existing logic paths, and gracefully falls through to existing xclip/xsel handling if wl-copy is unavailable.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/cli/src/tui/clipboard.ts Adds Wayland clipboard support via wl-copy, with correct ordering (after WSL, before xclip/xsel fallback) and consistent error handling. No issues found.

Last reviewed commit: 4dcd5c7

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Context used:

  • Context from dashboard - AGENTS.md (source)

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.

1 participant