I've been using WSL since nearly the beginning (2017 / 2018) and used VcXsrv back then to get bi-directional clipboard sharing before WSLg was available. For a brief time I even ran Sublime Text in WSL 1 way back in the day.
Then I used WSL 2.
Then I tried WSLg when it first came out and it was really bad. Clipboard sharing didn't work for me which was the only reason I wanted to use it. I set `guiApplications=false` and never looked back.
I just tried it again now by closing VcXsrv and removing any DISPLAY related settings I had in my zsh profile. Then I shutdown WSL and started up my instance.
Bingo, clipboard sharing "just works" and I also installed xcalc which ran flawlessly. This simplifies things so much.
I did notice a very bad side effect. Yesterday I only pasted 1 line. When you paste in multiple lines using Neovim's normal paste key (p), it adds a Windows line ending to each line which you can see as ^M.
This unfortunately makes pasting text from Windows into WSL a problem. The ^M isn't present when pasting with CTRL+SHIFT+v because I guess the Microsoft Terminal converts it but that's a big pain to hit compared to "p".
I just pushed an update to remove VcXsrv at: https://github.com/nickjj/dotfiles/commit/fdc1ddd95c2defb791...
As for why I was using it:
I've been using WSL since nearly the beginning (2017 / 2018) and used VcXsrv back then to get bi-directional clipboard sharing before WSLg was available. For a brief time I even ran Sublime Text in WSL 1 way back in the day.
Then I used WSL 2.
Then I tried WSLg when it first came out and it was really bad. Clipboard sharing didn't work for me which was the only reason I wanted to use it. I set `guiApplications=false` and never looked back.
I just tried it again now by closing VcXsrv and removing any DISPLAY related settings I had in my zsh profile. Then I shutdown WSL and started up my instance.
Bingo, clipboard sharing "just works" and I also installed xcalc which ran flawlessly. This simplifies things so much.