5

我的 settings.json 非常简单,它将 cmd.exe 替换为 sh.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 的 bash)一起使用吗?我该如何设置它才能工作?

4

1 回答 1

20

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

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

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

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

于 2017-01-08T01:38:44.283 回答