LIVE
Loading live headlines…
Home Trending World Technology Entertainment Gaming Sports Music Science Lifestyle Business About Contact
c/linux by u/CubitOom 6d ago aur.archlinux.org

I just fixed some weird copy/paste issues when trying to copy text using certain commands in my terminal on arch using Wayland, maybe this can help someone else out.

15 upvotes 0 comments
I'm using arch btw, with KDE and wayland. Posting this incase anyone else is having similar problems.

Some commands that relied on wl-copy like `pass -c` would return empty pastes.

My guess is that the xdg-mime query (from xdg-utils) returns empty output on KDE, and that wl-copy relies on this to determine the MIME type of piped data, and when it gets nothing back, the clipboard MIME type is corrupted.

The fix was replacing [wl-clipboard](https://archlinux.org/packages/extra/x86_64/wl-clipboard/) with [wl-clipboard-rs](https://aur.archlinux.org/packages/wl-clipboard-rs) which is a rust re-implementation of wl-copy/wl-paste that doesn't depend on xdg-mime for MIME detection.
Visit source Open discussion