bugaevc / wl-clipboard

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

Treat git patches as text #103

Open vinliao opened 4 years ago

vinliao commented 4 years ago

Same issue as #102, but for git patch files.

Steps to reproduce:

  1. Create a patch file with git format-patch.
  2. Let's assume that the file name is new.patch.
  3. Run cat new.patch | wl-copy
  4. Try pasting... nothing happens.

Just like #102, adding --type text/plain solves the issue, but it's a nuisance.

bugaevc commented 4 years ago

Just like in #102, you can copy git patches, it's just the target software that doesn't want to paste them 🙂

I should add a workaround for the type, but saying that you can't copy is just wrong.

vinliao commented 4 years ago

Oh... pardon my lack of understanding. So the clilpboard actually registers those unpasteable text, and it's the input text that rejects anything beside text/plain?

I thought it's about wl-copy rejecting anything that's not text/plain.

bugaevc commented 4 years ago

Yes, everything works except for pasting into the target application (because it doesn't think it can paste git patches, even though it can, because git patches are just text). Copying works, the clipboard works, pasting works — but the target app doesn't accept it.

You can always paste from the clipboard or inspect the actual state of clipboard using wl-paste:

I've previously shown you how to inspect the clipboard with it in https://github.com/bugaevc/wl-clipboard/issues/102#issuecomment-727175552. See the man page for some more things wl-clipboard can do for you.

Does that make sense / make it clearer what's going on?

vinliao commented 4 years ago

To be quite honest with you, I didn't inspect the clipboard when you showed me at #102. I just placed --type text/plain and went on with my day.

That's a misundertanding on my end, and yes, it makes sense now.