打开左下角齿轮图标
打开Settings
搜索框输入 terminal.integrated.profiles.windows, 在下方显示的内容上点击
Edit in settings.json
配置修改如下
"terminal.integrated.profiles.windows": {"PowerShell": {"source": "PowerShell","icon": "terminal-powershell"},"Command Prompt": {"path": ["${env:windir}\\Sysnative\\cmd.exe","${env:windir}\\System32\\cmd.exe"],"args": [],"icon": "terminal-cmd"},"GitBash": {"path": "D:\\Program Files\\Git\\bin\\bash.exe"}},"terminal.external.windowsExec": "D:\\Program Files\\Git\\bin\\bash.exe","terminal.integrated.defaultProfile.windows": "GitBash"
注意: GitBash不要写成 Git Bash, 中间有空格保存后没有效果。
在vscode中使用bash_vscode 运行bash_BAOYANG dl的博客-CSDN博客通过设置使windows的vscode中可以使用bash终端https://blog.csdn.net/weixin_43342476/article/details/126292368
GitBash 未在 Visual Studio Code 中显示为终端选项 | 如何解决GitBash 未在 Visual Studio Code 中显示为终端选项经验,为你挑选了3个好方法。https://qa.1r1g.com/sf/ask/4764785161/