bugaevc / wl-clipboard

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

plain text with char hex 0c (page-break-form-feed) different from behavior of xclip -> x-clipboard #237

Open SimonGerm opened 4 weeks ago

SimonGerm commented 4 weeks ago

Do the following: generate a simple online text in libreoffice24.8.2.1-1.2, export it as pdf (or print it with cups-pdf-printer)

from poppler tools use "pdftotext" it will now have the char hex 0c at the end. (behavior is same if its somewhere in middle of text)

do now: in X-session: textwith-0c -> xclip -> x-clipboard (ok, the text is shown in clipboard and could be pasted (mouse/middlebutton))

in wayland-session textwith-0c -> wl-copy -> wayland-clipboard (did not show contens when 0c is used, not possible to paste (mouse/middlebutton))

i am not sure if this is a problem of wl-copy or the wayland clipboard itself. when using wl-paste the contens will be outputted. but its not show (maybe never arriving) in clipboard of the desktop the enviorement: (plasma6.2.0-1.1 kdewayland6.2.0-1.1 all on opensuse tumbleweed 20241011)

workaround is to filter out the 0c of the textfile.

SimonGerm commented 4 weeks ago

to clarify: mouse/middlebutton AND OR strg+v it depends if using: | xclip | xclip -selection clipboard

wl-copy wl-copy -p

SimonGerm commented 4 weeks ago

here exact commands used: x-session: pdftotext -layout libreoffice-pdf.pdf - | xclip pdftotext -layout libreoffice-pdf.pdf - | xclip -selection clipboard

wayland-session: pdftotext -layout libreoffice-pdf.pdf - | wl-copy pdftotext -layout libreoffice-pdf.pdf - | wl-copy -p

and working version: pdftotext -layout "$1" - | sed -e 's/\x0c//g' | wl-copy pdftotext -layout "$1" - | sed -e 's/\x0c//g' | wl-copy -p

SimonGerm commented 4 weeks ago

filed also a bug to opensuse /kde-plasma:

https://bugzilla.opensuse.org/show_bug.cgi?id=1232228

bugaevc commented 4 weeks ago

Hi, so if copying with wl-copy and subsequently pasting with wl-paste works, this means wl-copy succeeds in copying the 0c byte to the clipboard. So the issue must be then in whichever other way that you're accessing the "clipboard of the desktop".