Open
Conversation
- Add --type MIMETYPE option for any MIME type (e.g. image/png) - Add --html shortcut for --type text/html - Add --query option to list available clipboard targets - Implement text/binary MIME type whitelist with fallback logic - Binary MIME types (image/png) only register specific atom - Text MIME types (text/html, application/json) register both specific + text fallbacks - All existing functionality preserved for backwards compatibility
- Add sel_length global variable to track actual binary data size - Update handle_mime_string() to use sel_length for binary data - Use xs_strlen() for text data, actual byte count for binary data - Fixes issue where xs_strlen() truncated binary data at null bytes - GIMP can now successfully paste PNG images from xsel
|
This is great—looks like I can finally drop I tested copying One request: could MIME types support also be extended to output operations? For example: xsel --type 'image/png' --output --clipboardCurrently, this results in the following error: |
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.
Add universal MIME type support
New Features
--type MIMETYPEfor any MIME type (e.g.,--type "image/png",--type "text/html")--htmlshortcut for--type "text/html"--queryoption to list available clipboard targetsExamples
Binary data (images):
Technical Details
Compatibility
Tested with GIMP (PNG images), Gmail (HTML), and various text editors.