1.点击左下角的齿轮,展开点击设置
2.搜索shell,找到Terminal › Integrated › Shell: Windows设置,进行编辑
3.在配置文件中,配置git的bash.exe的路径
4.VSCode更新后,之前的配置会提示错误:
此项已弃用,配置默认 shell 的新推荐方法是在 `#terminal.integrated.profiles.windows#` 中创建一个终端配置文件,并将其配置文件名称设置为 `#terminal.integrated.defaultProfile.windows#` 中的默认值。此操作当前将优先于新的配置文件设置,但将来会发生更改。(2)
终端在 Windows 上使用的 shell 的路径。详细了解如何配置 shell。
5.ctrl+shift+p打开配置项,搜索setting.json将以下代码添加
"terminal.integrated.profiles.windows": {
"PowerShell -NoProfile": {
"source": "PowerShell",
"args": [
"-NoProfile"
]
},
"Git-Bash": {
"path": "D:\\tools\\Git\\bin\\bash.exe",
"args": []
}
},
"terminal.integrated.defaultProfile.windows": "Git-Bash",
6.重启vscode
网友评论