wl-clipboard icon indicating copy to clipboard operation
wl-clipboard copied to clipboard

application/x-zerosize detected when copying from stdin

Open shlevy opened this issue 3 years ago • 3 comments
trafficstars

$ 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)

shlevy avatar Sep 23 '22 13:09 shlevy

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.

YaLTeR avatar Sep 23 '22 15:09 YaLTeR

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

shlevy avatar Sep 23 '22 20:09 shlevy

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'

b-m-f avatar Oct 17 '22 11:10 b-m-f