原教程是在setting.json
配置文件中加上这句:
"terminal.integrated.shell.windows": "D:\\Program Files\\Git\\bin\\bash.exe",
但新版本的vscode配置却提示错误:
This is deprecated, use
#terminal.integrated.defaultProfile.windows#
instead
点击“详细了解如何配置shell”
跳转至官网文档:https://code.visualstudio.com/docs/editor/integrated-terminal#_configuring-profiles
大致内容如下:
所以对着文档信息
把修改好的git pash目录,放到配置文件中即可
"terminal.integrated.profiles.windows": {
"Git Bash": {
"path": "D:\\Program Files\\Git\\bin\\bash.exe"
},
"PowerShell -NoProfile": {
"source": "PowerShell",
"args": ["-NoProfile"]
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash",
重启vs code
即自动选择git bash
终端
也可根据自己要求,选择PowerShell
终端