效果

解决步骤

  1. 找到git安装目录下的/bin/bash.exe,复制其绝对路径,例如
    D:\Program Files\Git\bin\bash.exe
  2. 把路径的右斜杠转义,例如
    D:\\Program Files\\Git\\bin\\bash.exe
    其实就是一个斜杠变两个
  3. 在vscode中按F1,输入settings.json不要回车,选择“打开设置(json)”
  4. 按实际情况,修改为
    {
        "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"
            },
            "Git-Bash": {
                "path": "D:\\Program Files\\Git\\bin\\bash.exe",
                "args": []
            }
        },
        "workbench.colorTheme": "Default Light+",
        "workbench.startupEditor": "none",
        "files.autoSave": "afterDelay",
        "security.workspace.trust.untrustedFiles": "open"
    }

  5. 保存,ok!

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐