windows下修改vscode默认终端为git bash

1.点击左下角的齿轮,展开点击设置

 

 

 

2.点击该处,打开设置配置文件,在配置文件中,配置git的bash.exe的路径

 

 

方法

参考官方文档,修改配置文件,将下面的配置加到 setting.json文件。

"terminal.integrated.profiles.windows": {
    "PowerShell -NoProfile": {
      "source": "PowerShell",
      "args": [
        "-NoProfile"
      ]
    },
    "Git-Bash": {
      "path": "D:\\Program Files\\Git\\bin\\bash.exe",
      "args": []
    }
  },
"terminal.integrated.defaultProfile.windows": "Git-Bash",

注意:上面的配置是要加到配置的大括号里面的

 

 注: 如不成功可采用如下配置:

vscode版本1.57.1 , 2021.6.28 可以使用这个, 地址修改自己的bash实际地址

 

 


{
"terminal.integrated.profiles.windows": {
"Command Prompt": {
"path": "D:\\install\\Git\\bin\\bash.exe",
"icon": "terminal-cmd"
}
},
"terminal.integrated.defaultProfile.windows": "Command Prompt",
}

评论区:解决第一次打开一直为powershell
"terminal.integrated.profiles.windows": {
"Git-Bash": {
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
"args": []
},
"PowerShell -NoProfile": {
"source": "PowerShell",
"args": ["-NoProfile"]
}
},

把git bash放到上面,重启vsc,第一次打开terminal是git bash了。版本1.60.0。[滑稽]

posted @ 2021-09-15 10:44  ____chen  阅读(1241)  评论(0编辑  收藏  举报