VSCode终端+ Git Bash"命令未找到"任何命令

时间:2017-01-08 01:20:05

标签: visual-studio-code vscode-settings

我的settings.json很简单,它用sh.exe替换cmd.exe(来自git)。

{
    "terminal.integrated.shell.windows": "C:\\Program Files (x86)\\Git\\bin\\sh.exe"
}
打开外壳时,绝对没有任何作用。我甚至不能。

sh.exe"-3.1$ ls
sh.exe": ls: command not found
sh.exe"-3.1$ cd ..
sh.exe"-3.1$ ls
sh.exe": ls: command not found
sh.exe"-3.1$

VSCode不适用于Mingw32(git' sash)吗?如何设置它?

1 个答案:

答案 0 :(得分:11)

所以git bash需要两个参数--login和单独的-i

因此,完整的json需要看起来像:

{
    "terminal.integrated.shell.windows": "C:\\Program Files (x86)\\Git\\bin\\bash.exe",
    "terminal.integrated.shellArgs.windows": ["--login","-i"]
}

这将导致所有命令在集成终端中工作。