Skip to content

fix(wl-copy): assume mime text/plain, avoid clipboard manager refusin… #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dezza
Copy link

@dezza dezza commented Jun 10, 2025

If we don't supply a text/plain mime-type to wl-copy it will constantly assume types from text that can be problematic for some clipboard managers to handle.

Because wl-copy detects via xdg-mime if it lacks a --type arg ( https://github.com/bugaevc/wl-clipboard/blob/master/src/util/files.c#L173 )

u@:~$ echo 'BEGIN {}' > mimetest
u@:~$ xdg-mime query filetype mimetest
application/x-perl

In this case clipboard manager such as https://invent.kde.org/plasma/plasma-workspace/-/tree/master/klipper

Is strict and assume it is binary data (file copied) copied, which makes sense.

I don't really see a need to assume anything but text/plain unless someone can come with a legit reason to oppose this PR.

…g to paste

If we don't supply a `text/plain` mime-type to `wl-copy` it will constantly assume types from text that can be problematic for some clipboard managers to handle.

In this case clipboard manager such as https://invent.kde.org/plasma/plasma-workspace/-/tree/master/klipper

Is strict and assume it is binary data (file copied) copied, which makes sense.

I don't really see a need to assume anything but `text/plain` unless someone can come with a legit reason to oppose this PR.
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