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

Cannot paste clipboard text from the program xclip #159

Closed
Ghibranalj opened this issue Jan 19, 2022 · 7 comments
Closed

Cannot paste clipboard text from the program xclip #159

Ghibranalj opened this issue Jan 19, 2022 · 7 comments
Labels
bug Something isn't working good first issue Good for newcomers invalid This doesn't seem right

Comments

@Ghibranalj
Copy link

Ghibranalj commented Jan 19, 2022

Description
Cannot paste a text that is copied fron the program xclip. but 'paste as plain' text works

To Reproduce
Steps to reproduce the behavior:

  1. Copy the content of a file to clipboard with the command xclip -sel c < text.txt
  2. Paste it to whatsapp-for-linux to any input field
  3. No text shows up

Expected behavior
The selected text gets pasted

Video demonstration
the video demonstration

Environment

  • Arch Linux
  • aur (yay)
  • Cinnamon 5.0.7
  • kernel 5.15.10-arch1-1
@Ghibranalj Ghibranalj added the bug Something isn't working label Jan 19, 2022
@xeco23 xeco23 added the good first issue Good for newcomers label Jan 19, 2022
@xeco23
Copy link
Owner

xeco23 commented Mar 2, 2022

Probably related to #177. I will keep both issues for now as I am not sure if this is only a Wayland issue.

@Ghibranalj
Copy link
Author

I use gnome on x11 not on wayland

@xeco23
Copy link
Owner

xeco23 commented Mar 4, 2022

I've tested this on both X11 and Wayland and couldn't reproduce. Could you please check again?

@xeco23
Copy link
Owner

xeco23 commented Mar 4, 2022

Okay, I got it now. Strangely, this only happens with xclip.

@xeco23
Copy link
Owner

xeco23 commented Mar 4, 2022

xclip -selection clipboard -t text/plain < test.txt
It works when you select the target as plain text. Somewhat, this explains the issue. I believe xclip copies text with a rich format by default and that's why it works when you click Paste as Plain Text and GTK framework have both of those paste options for convenience I guess, as compared to other frameworks. However, I don't understand why Paste option doesn't work for rich text formats and I am not sure what needs to be done at this point.

@xeco23 xeco23 changed the title Cannot paste a selection from the program xclip Cannot paste clipboard text from the program xclip Mar 4, 2022
@xeco23
Copy link
Owner

xeco23 commented Mar 6, 2022

Okay, I think I understand now;

If you try to paste a rich text, it depends on the application/website to accept this input. In this case, Whatsapp Web doesn't allow this.

So, either you should use Paste as a Plain Text / Ctrl+Shift+V or copy your text in a plain format.

Since this is expected behavior, I will close this if no one has an objection.

@Sadi58
Copy link

Sadi58 commented Mar 13, 2022

Thanks! Replacing the command xclip -i -selection clipboard with xclip -i -selection clipboard -t text/plain in a couple of my scripts, or/and - in some cases - using Ctr+Shift+V instead of Ctrl+V works great for me.

@xeco23 xeco23 closed this as completed Mar 30, 2022
@xeco23 xeco23 added the invalid This doesn't seem right label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants