Skip to content

fix(tui): add wl-paste text read for Wayland systems#29881

Open
zackslash wants to merge 1 commit into
anomalyco:devfrom
zackslash:fix/wayland-text-clipboard-read
Open

fix(tui): add wl-paste text read for Wayland systems#29881
zackslash wants to merge 1 commit into
anomalyco:devfrom
zackslash:fix/wayland-text-clipboard-read

Conversation

@zackslash
Copy link
Copy Markdown

@zackslash zackslash commented May 29, 2026

Issue for this PR

Closes #29880

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

On Wayland systems without xsel/xclip, prompt.paste (Ctrl+V) silently fails. The read() function tries wl-paste for images but delegates text reads to clipboardy, which uses xsel on Linux. The error gets swallowed by .catch(() => {}).

The write path already checks WAYLAND_DISPLAY and uses wl-copy. This adds the same pattern to the text read path, trying wl-paste -n --no-newline before the clipboardy fallback.

How did you verify your code works?

Built from source, replaced the local binary, and confirmed text paste works on a Wayland session (Ghostty + tmux) without xsel/xclip installed. Typecheck passes.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

The clipboard read() function tries wl-paste for images on Linux,
but falls back to clipboardy (xsel) for text. On Wayland systems
without xsel, text paste silently fails.

Add a wl-paste text read path before the clipboardy fallback,
guarded by WAYLAND_DISPLAY, mirroring the existing write path.

Closes anomalyco#29880
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Clipboard text paste silently fails on Wayland without xsel/xclip

1 participant