Map Linux clipboard MIME types to macOS UTIs - #4
Open
sud0n1m wants to merge 1 commit into
Open
Conversation
NSPasteboard rejects Wayland/X11 type names such as text/plain, image/png, and UTF8_STRING. Copies from Linux therefore published an empty pasteboard even when the SSH bridge was healthy. Normalize known portable formats to UTIs before publish, collapse duplicates, and skip remaining non-UTI types.
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.
Problem
Linux Wayland/X11 clipboards advertise types such as
text/plain,text/plain;charset=utf-8,UTF8_STRING, andimage/png. macOSNSPasteboardonly accepts UTIs. Applying those names as-is logs:and then
native clipboard was empty immediately after publishing. Mac → Linux still works because capture already adds portable aliases.Reproduced on ssh-clipboard 0.2.8 between Omarchy (Hyprland/Wayland) and macOS 26, with a healthy persistent SSH bridge.
Change
On macOS apply:
text/plain→public.utf8-plain-text,image/png→public.png, and the rest of the existing alias table in reverse).STRING,TEXT, custom MIME) instead of handing them to NSPasteboard.Linux capture is unchanged. This is the apply-side half of the portable alias table already documented for macOS capture.
Test plan
pbpastematcheswl-pastematchesclipboard infoincludesPNGf