I'm on Windows 11, and trying to automate the following with a .bat script:
- Create a new instance of Alacritty terminal
- Enter WSL inside of the Alacritty terminal
- Open NeoVim after entering WSL
I have gotten as far as steps 1 and 2, but cannot seem to work out step 3. This is what my .bat file looks like right now:
@echo off
start "" "C:\Program Files\Alacritty\alacritty.exe" -e wsl
exit
I have tried adding -e nvim
, but that just causes this error:
<3>WSL (398) ERROR: CreateProcessEntryCommon:577: execvpe nvim failed 2
<3>WSL (398) ERROR: CreateProcessEntryCommon:586: Create process not expected to return
In addition, replacing -e wsl
with -e "wsl nvim"
gives me command not found
, even though I have confirmed that NeoVim is added to my $PATH
in WSL.
I recommend to have your .bashrc start Neovim when it is sourced upon Linux loading up.
Meaning add
bash nvim
to your .bashrc file on the WSL side to immediately start neovim once your script switching to WSL ends.