wl-clipboard
wl-clipboard copied to clipboard
Copying text from STDIN does not work if the text starts with `MM`
Issue and Steps to reproduce
$ echo -n MM | wl-copy
$ echo -n MMm | wl-copy
It's expected that MM / MMm will be copied to clipboard, but actually nothing will be copied to clipboard.
Causes
I think this is caused by xdg-mime misidentifying the file type when a text file starts with MM.
$ echo -n MM > text
$ xdg-mime query filetype text
image/x-3ds
Versions
OS: Arch Linux x86_64
$ wl-copy -v
wl-clipboard 2.2.1
Copyright (C) 2018-2023 Sergey Bugaev
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ xdg-mime --version
xdg-mime 1.2.1
Hi,
I think this is caused by
xdg-mimemisidentifying the file type when a text file starts withMM.
Sounds so indeed. You should report it to them, and in the meantime, either copy it through argv (wl-copy MMm) or set the type using --type "text/plain;charset=utf-8"