fix(tui): add wl-paste text read for Wayland systems#29881
Open
zackslash wants to merge 1 commit into
Open
Conversation
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
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #29880
Type of change
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