将GitBash设置为VS Code的默认终端

这个东西搞了半天,真的无语。。。网上的东西都太旧了

注意:"terminal.integrated.shell.windows"2021年4月起已弃用。

1、首先打开设置

 2、进入settings.json,准备编辑设置文件

 3、编辑json文件中终端的安装路径

注意这里的终端名字一定要是GitBash不然识别不出来,我就是这里搞错了写成了Git Bash一直没有显示

复制代码
{
    "workbench.colorTheme": "Default Dark+", 
    "files.autoSave": "onFocusChange",
    "git.path": "D:\\Program Files\\Git\\bin\\git.exe",
    "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": {
       //换成自己的Bash的安装路径   "path": "D:\\Program Files\\Git\\bin\\bash.exe", "icon": "terminal-bash" } },
  //默认终端的选择 "terminal.integrated.defaultProfile.windows": "GitBash", }
复制代码

参考文献:

https://stackoverflow.com/questions/68068359/gitbash-not-showing-up-as-a-terminal-option-in-visual-studio-code

posted @   雨天尊  阅读(165)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术
点击右上角即可分享
微信分享提示