本文介绍: 如果配置gitbash.exe 路径,则会单独打开 git bash 窗口,而不是嵌入 vscode 终端页签中。注意不要配置 gitbash.exe路径

vscode配置终端默认git bash

ctrl + shift + p 打开设置

在这里插入图片描述

添加 git bash 并设为默认终端

注意不要配置 gitbash.exe路径
如果配置gitbash.exe 路径,则会单独打开 git bash 窗口,而不是嵌入 vscode 终端页签中。

{
	"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": "C:\Program Files\Git\git-bash.exe",
            "path": "C:\Program Files\Git\bin\bash.exe",
            "args": []
        }
    },
    "terminal.integrated.defaultProfile.windows": "Git Bash"
}

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注