bugaevc / wl-clipboard

Command-line copy/paste utilities for Wayland
GNU General Public License v3.0
1.62k stars 59 forks source link

application/x-zerosize detected when copying from stdin #148

Open shlevy opened 2 years ago

shlevy commented 2 years ago
$ wl-copy --version
wl-clipboard 2.1.0
Copyright (C) 2019 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.

$ wl-copy foo 2>arg.txt # arg.txt attached

$ WAYLAND_DEBUG= wl-paste -l
UTF8_STRING
STRING
TEXT
text/plain;charset=utf-8
text/plain

$ echo foo | wl-copy 2>stdin.txt # stdin.txt attached

$ WAYLAND_DEBUG= wl-paste -l
application/x-zerosize

arg.txt stdin.txt

This breaks e.g. password-store when pasting in a graphical application (though wl-paste does find the clipboard contents)

YaLTeR commented 2 years ago

Hm, seems weird. For now I guess password-store could set a text MIME type explicitly? Sounds like a good idea either way in case a password happens to match some ASCII format.

shlevy commented 2 years ago

https://lists.zx2c4.com/pipermail/password-store/2022-September/004651.html

b-m-f commented 2 years ago

Hm, seems weird. For now I guess password-store could set a text MIME type explicitly? Sounds like a good idea either way in case a password happens to match some ASCII format.

This works. E.g -t 'text/plain'