我使用的是 Windows 11,并尝试使用 .bat 脚本自动执行以下操作:
我已经完成了步骤 1 和 2,但似乎无法计算出步骤 3。这就是我的 .bat 文件现在的样子:
@echo off
start "" "C:\Program Files\Alacritty\alacritty.exe" -e wsl
exit
我尝试添加
-e nvim
,但这只会导致此错误:
<3>WSL (398) ERROR: CreateProcessEntryCommon:577: execvpe nvim failed 2
<3>WSL (398) ERROR: CreateProcessEntryCommon:586: Create process not expected to return
此外,用
-e wsl
替换 -e "wsl nvim"
会给我 command not found
,即使我已经确认 NeoVim 已添加到 WSL 中的我的 $PATH
中。
不确定您是否找到了解决方案,但为什么不让您的 .bashrc 在 Linux 加载时启动 Neovim?