I followed the instructions given in this answer: https://vi.stackexchange.com/a/16436/25843, and I've set my shell to point to wsl.exe like this (wsl.exe path seems to be different on my machine compared to the linked answer):
if has("windows")
set shell=C:\Windows\System32\wsl.exe
set shellpipe=|
set shellredir=>
set shellcmdflag=
endif
But I end up getting this error if I try to run, let's say :!ls
:
C:\Windows\System32\wsl.exe "ls"
'C:\Windows\System32\wsl.exe' is not recognized as an internal or external command,
operable program or batch file.
shell returned 1
Hit any key to close this window...
However, directly running C:\Windows\System32\wsl.exe "ls"
in the command line seems to work. Also, setting the shell to point to the PowerShell executable seems to work as well, so I'm confused about what I am missing here.