Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat git patches as text #103

Open
vinliao opened this issue Nov 23, 2020 · 4 comments
Open

Treat git patches as text #103

vinliao opened this issue Nov 23, 2020 · 4 comments

Comments

@vinliao
Copy link

vinliao commented Nov 23, 2020

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
Copy link
Owner

bugaevc commented Nov 23, 2020

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.

@bugaevc bugaevc changed the title Can't copy git patch files Treat git patches as text Nov 23, 2020
@vinliao
Copy link
Author

vinliao commented Nov 23, 2020

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
Copy link
Owner

bugaevc commented Nov 23, 2020

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:

  • wl-paste will always paste what's currently in the clipboard (unlike all those other apps, it doesn't refuse pasting unknown types), so you can use it to check whether something has actually been copied or not
  • wl-paste --list-types (or wl-paste -l for short) will list the types the current selection is offered in (such as plain/text or application/pgp-encrypted)

I've previously shown you how to inspect the clipboard with it in #102 (comment). 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
Copy link
Author

vinliao commented Nov 23, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants