prasanthrangan / hyprdots

// Aesthetic, dynamic and minimal dots for Arch hyprland
GNU General Public License v3.0
7.4k stars 864 forks source link

[Bug]: Cannot paste text from Google Chrome to VSCode #1914

Closed sharjeelmazhar closed 4 weeks ago

sharjeelmazhar commented 4 weeks ago

Bug Report

Description

I am experiencing an issue where I cannot paste text copied from Google Chrome into VSCode on Arch Linux with Hyprland. The pasting functionality works fine between other applications (e.g., Zed Editor, Firefox, Terminal), but specifically fails with text copied from Google Chrome to VSCode. The only workaround I found is using the clipboard manager (triggered by Win/Mod + V) to manually select and then paste the text using Ctrl + V, which is not required with any other applications.

Steps to Reproduce

  1. Copy any text from Google Chrome.
  2. Attempt to paste directly into VSCode using Ctrl + V.
  3. Observe that the paste operation does not work.
  4. Press Win/Mod + V to open the clipboard manager and select the recently copied text.
  5. Press Enter, then use Ctrl + V to paste into VSCode, which then works.

Expected Behavior

I expected to paste text directly from Google Chrome into VSCode using the standard Ctrl + V shortcut without additional steps.

Actual Behavior

Text copied from Google Chrome cannot be pasted directly into VSCode using Ctrl + V. It requires an additional step involving the clipboard manager to manually select the text for pasting.

Environment

Additional Information

This issue only appears when copying from Google Chrome; other applications do not exhibit this problem. It affects workflow efficiency significantly, especially when working with code and web content simultaneously. No recent changes were made to the system or VSCode that might have caused this issue.

kRHYME7 commented 4 weeks ago

yeah

sharjeelmazhar commented 4 weeks ago

yeah

what the fix?

kRHYME7 commented 4 weeks ago

what the fix?

This issue on VS Code occurred months ago. I never experience this back then as I'm using vscodium. Fast-forward, I experienced this after a couple of updates from vscoidum. I don't know the fix, either.

It is wise to ask for help to the repos responsible for this .

https://github.com/sentriz/cliphist - Stores the text/image https://github.com/bugaevc/wl-clipboard - Service that storesthe copied files to cliphist https://code.visualstudio.com/ - This too https://github.com/hyprwm/Hyprland - Just in case

As you and I observed, it gets copied to the clipboard but when you try to paste it suddenly it won't paste

We are just a lowly configuration files repo here, if you can confirm that this is due to some error on the dotfiles, please reach us so we could fix it.

kRHYME7 commented 4 weeks ago

but specifically fails with text copied from Google Chrome to VSCode. T

Happens ALL the time?

If yes, then be sure to run Google Chrome as Wayland.

image

By default, chrome is launch as xwayland thus giving you this error

Another method that works for arch is this https://wiki.archlinux.org/title/Chromium#Making_flags_persistent

kRHYME7 commented 4 weeks ago

to query if google chrome is on Xwayland,

run hyprctl clients image

This says that I am not running google-chrome as Xwayland which fixes the above issue.