▲ 6 r/neovim

Vim in WSL: `+yy` gives `W23: Clipboard register not available` despite `+clipboard`

I'm running Vim inside WSL and can't get the \`+\` register to work.

When I try:

`"+yy`

I get:

`W23: Clipboard regiter not available, using register 0`

However:

:echo has('clipboard')               "1
:echo has('unnamedplus')             "1

vim --version | grep clipboard
+clipboard
+xterm\_clipboard

I'm running /usr/bin/vim.gtk3, but:

  • $DISPLAY is empty
  • $WAYLAND\_DISPLAY is empty
  • xclip/xsel are not installed
  • clip.exe workgs from WSL (echo test | /mnt/c/Windows/System32/clip.exe)

Is this expected because I'm runnign a headless TTY, or should `vim.gt3` still be able to use the Windows clipboard? Is `win32yank.exe` the recommended solution?

reddit.com
u/logikwright — 2 days ago
▲ 3 r/vim

Vim in WSL: `+yy` gives `W23: Clipboard register not available` despite `+clipboard`

I'm running Vim inside WSL and can't get the `+` register to work.

When I try:

"+yy

I get:

W23: Clipboard regiter not available, using register 0

However:

:echo has('clipboard')               "1
:echo has('unnamedplus')             "1

vim --version | grep clipboard
+clipboard
+xterm_clipboard

I'm running /usr/bin/vim.gtk3, but:

  • $DISPLAY is empty
  • $WAYLAND_DISPLAY is empty
  • xclip/xsel are not installed
  • clip.exe workgs from WSL (echo test | /mnt/c/Windows/System32/clip.exe)

Is this expected because I'm runnign a headless TTY, or should vim.gt3 still be able to use the Windows clipboard? Is win32yank.exe the recommended solution?

reddit.com
u/logikwright — 2 days ago
▲ 6 r/ssh

What's the best way to SSH directly into WSL2 from another Linux machine?

Hi everyone,

I'm a bit confused about what the "right" way to do this is.

I have a Windows PC running Debian in WSL2, and I have another Debian laptop.

My goal is to make WSL my main development environment and SSH into it from the laptop.

I first tried using the Windows OpenSSH server with ForceCommand to launch WSL. That actually lets me log in directly into WSL, which looked perfect at first. The problem is that normal SSH commands don't seem to work.

For example:

**ssh my-pc**

works fine, but

**ssh my-pc "pwd"**

just hangs. rsync also hangs because it uses remote commands over SSH.

So I started wondering if this is just the wrong approach.

I already have **sshd** running inside WSL, but since WSL is using NAT, it gets a 172.x.x.x IP that changes, so I don't know if that's supposed to be the way either.

I've been reading about mirrored networking, port forwarding, Windows OpenSSH, etc., and now I'm more confused than when I started.

For those of you who use WSL as your main Linux machine, what's the recommended setup nowadays?

Ideally I'd like:

  1. ssh my-pc

  2. ssh my-pc "command"

  3. rsync

  4. scp

  5. VS Code Remote SSH

to all work without weird workarounds.

Am I overcomplicating this? How are you guys doing it?

Thanks!

reddit.com
u/logikwright — 7 days ago
▲ 27 r/bashonubuntuonwindows+1 crossposts

What's the best way to SSH directly into WSL2 from another Linux machine?

Hi everyone,

I'm a bit confused about what the "right" way to do this is.

I have a Windows PC running Debian in WSL2, and I have another Debian laptop.

My goal is to make WSL my main development environment and SSH into it from the laptop.

I first tried using the Windows OpenSSH server with ForceCommand to launch WSL. That actually lets me log in directly into WSL, which looked perfect at first. The problem is that normal SSH commands don't seem to work.

For example:

ssh my-pc

works fine, but

ssh my-pc "pwd"

just hangs. rsync also hangs because it uses remote commands over SSH.

So I started wondering if this is just the wrong approach.

I already have sshd running inside WSL, but since WSL is using NAT, it gets a 172.x.x.x IP that changes, so I don't know if that's supposed to be the way either.

I've been reading about mirrored networking, port forwarding, Windows OpenSSH, etc., and now I'm more confused than when I started.

For those of you who use WSL as your main Linux machine, what's the recommended setup nowadays?

Ideally I'd like:

  1. ssh my-pc

  2. ssh my-pc "command"

  3. rsync

  4. scp

  5. VS Code Remote SSH

to all work without weird workarounds.

Am I overcomplicating this? How are you guys doing it?

Thanks!

reddit.com
u/logikwright — 8 days ago