-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Copy/paste from system clipboard does not work on WSL2 #2132
Comments
Do the yank-to-system-clipboard and paste-from-system-clipboard commands work? Spacey to yank and Spacep to paste. |
Nope; save behaviour as above. They clearly get saved to some clipboard -- presumably the Ubuntu one -- as this system-yank/paste works within just Helix itself. |
This does work in Windows 10/WSL2, but requires additional user configuration.
it's important to note that Windows 10 WSL does not support X11/Wayland out-of-the-box, so it's no surprise that Helix system clipboard support isn't working without However, this can be configured to work in several different ways:
Believe it or not, I've just tested all three of these approaches. |
Am I correct in thinking that
means that, there is already something in motion that will fix this issue? In other words, should we just sit still and wait patiently for it to be fixed? |
@nekodjin Well, sort of. All three options have external dependencies, but the one with the fewest dependencies for Windows 10 involves either building from source or waiting patiently, yes. Side note -- Looking at the source, I think it's possible to implement the system clipboard on WSL in a way that "just works" with a standard Windows 10/11 installation with no additional dependencies. But that's going to require an additional code change if so. |
Addressed by #1912 |
I have an issue currently where I am able to copy from helix to system (Win10) but not the other way around. I just installed helix on my Ubuntu distro under WSL2 (latest version). Any ideas on how I can troubleshoot? Any command I can run to get info for you to troubleshoot? Running latest WSL2 (which has support for running GUIs natively etc), do I need to install any extra dependency or is it supposed to work out-of-the-box? |
Yeah, you need to install win32yank. |
Ok, thank you! This should probably be added to the installation instructions However:Should I install it in WSL or on the Windows side? -- I went ahead and installed Now pasting from system clipboard works in Helix, but as described above there is a latency of 2-3 seconds for just a single line of text. |
It's unclear if there is a better solution. https://github.com/neovim/neovim/wiki/FAQ#how-to-use-the-windows-clipboard-from-wsl suggests that if Helix is also installed in WSL, you can install |
In researching this, I also came across the currently still open #7219. Installed
fixed the issue for me. |
Summary
As title. I don't see any obvious way to copy or paste from the Windows 10 clipboard when using Helix on Windows Subsystem for Linux (WSL) 2.
Reproduction Steps
When pasting:
hx
i
insert modeConversely, when selecting text inside Helix, I get the message "yanked main selection to system clipboard", but it cannot be pasted from the Windows environment. I assume it only gets as far as the wrapped Ubuntu.
In contrast Vim seems to handle this seamlessly. (Ironically I actually had to use Vim to copy-paste my
config.toml
in #2131.)Helix log
No response
Platform
Windows WSL2, Ubuntu 20.04
Terminal Emulator
Hmm, whatever the WSL2 default is. Sorry!
Helix Version
git describe
: 22.03-89-g450f3489;hx -V
: helix 22.05-dev (450f348)The text was updated successfully, but these errors were encountered: