什么?VScode 1.60 Git bash不见了?

1,177 阅读1分钟

Bash 不见了

某天,当我随手更新了vscode之后,突然发现之前配置好的gitbash终端不见了,默认终端也变成了丑陋的powershell,看了下setting的配置项,发现从1.60.0之后,vscode对git bash的设置做了调整。

改配置

打开设置,Ctrl + shift + p, 输入settings

image.png

首先找到bash文件的安装路径,如我的是C盘C:\\Program Files (x86)\\Git\\bin\\bash.exe,需要注意的是文件路径不是C:\\Program Files (x86)\\Git\\git-bash.exe,否则vscode命令行会打开单独的git bash窗口,是bash.exe.

配置文件需要把terminal.integrated.defaultProfile.windows设置为配置过的terminal.integrated.profiles.windows,如下

"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.profiles.windows": {
  "PowerShell": {
    "source": "PowerShell",
    "icon": "terminal-powershell"
  },
  "Git Bash": {
    "path": "C:\\Program Files (x86)\\Git\\bin\\bash.exe",
    "args": []
  },
},

然后重启vscode就好。