最近我尝试开始使用Oh My ZSH!,看起来不错,但在工作中我无法安装Windows Subsystem for Linux,因此我决定使用Cygwin。经过一些教程阅读后,我将Oh My ZSH!作为Conemu作为我的默认控制台,使用agnoster主题并完美运行。然后我尝试向前迈出一步,开始在我的Oh My ZSH!终端中使用vscode并遇到类似这样的问题:
在我的vscode设置中,我有这个:
"terminal.integrated.shell.windows": "C:\\tools\\cygwin\\bin\\zsh.exe"
尝试使用任何命令时也会发生bash:
bash: ls: command not found
这就是我在 PATH 变量中的含义:
/usr/local/bin:/usr/bin:/usr/bin:/cygdrive/c/Program Files/ConEmu/ConEmu/Scripts:/cygdrive/c/Program Files/ConEmu:/cygdrive/c/Program Files/ConEmu/ConEmu:/cygdrive/c/Program
Data/Oracle/Java/javapath:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/
Program Files/Microsoft SQL Server/130/Tools/Binn:/cygdrive/c/Program Files/dotnet:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/130/Tools/Binn:/cygdrive/c/Program Fi
les (x86)/Microsoft SQL Server/130/DTS/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/130/DTS/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/130/To
ols/Binn:/cygdrive/c/ProgramData/chocolatey/bin:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/Client SDK/ODBC/130/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft
SQL Server/140/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/140/DTS/Binn:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/140/Tools/Binn/ManagementSt
udio:/cygdrive/c/Program Files/Microsoft SQL Server/140/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/140/DTS/Binn:/cygdrive/c/Program Files (x86)/NVIDIA Corpora
tion/PhysX/Common:%NVM_HOME%:%NVM_SYMLINK%:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Program Files (x86)/Yarn/bin:/cygdrive/c/Users/ddieppa/AppData/Local/Microsoft/Windo
wsApps:/cygdrive/c/Program Files/Microsoft VS Code/bin:/cygdrive/c/Users/ddieppa/AppData/Roaming/npm:/cygdrive/c/nvm:/cygdrive/c/Program Files/nodejs:/cygdrive/c/Users/ddiep
pa/AppData/Local/GitHubDesktop/bin:/cygdrive/c/Program Files/SQL Operations Studio/bin:/cygdrive/c/Users/ddieppa/AppData/Local/Yarn/bin:/cygdrive/c/Program Files/Microsoft V
S Code Insiders/bin
如何Oh My ZSH! Cygwin vscode在我的{{3}}终端上工作?
答案 0 :(得分:1)
档案 - >偏好 - >设置
{
"terminal.external.windowsExec": "C:\\Cmder\\Cmder.exe",
"terminal.integrated.shell.windows": "C:\\Cygwin64\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["-lic", "cd $OLDPWD; exec zsh"]
}

关键部分是第三行;显然如果你没有它,PATH没有
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}