首页 > 其他 > 详细

VS Code 终端设置为Git Bash

时间:2021-05-30 00:14:00      阅读:39      评论:0      收藏:0      [点我收藏+]

1、打开设置:

技术分享图片

2、搜索

输入shell:windowssetting.json中编辑

技术分享图片

或者直接打开设置json

技术分享图片

3、配置

json文件中默认配置
如果你的json配置文件中没有如下参数,直接复制拿走
对应路径改成自己本地即可

{
    "workbench.iconTheme": "vscode-icons",
    "git.ignoreWindowsGit27Warning": true,
    "vsicons.dontShowNewVersionMessage": true,
    "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": {
            "source": "Git Bash"

        },
        "Windows PowerShell": {
            "path": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
        }
    },
    "terminal.integrated.defaultProfile.windows": "Windows PowerShell"
}

修改成如下配置

{
    "workbench.iconTheme": "vscode-icons",
    "git.ignoreWindowsGit27Warning": true,
    "vsicons.dontShowNewVersionMessage": true,
    "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": {
            // "source": "Git Bash"
            "path": "E:\\Program Files\\Git\\bin\\bash.exe" //设置并添加git-bash的local安装路径
        },
        "Windows PowerShell": {
            "path": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
        }
    },
    "terminal.integrated.defaultProfile.windows": "Git Bash"
}

4、重启VS Code

可以看到默认打开Git Bash终端、也可选择其他终端
技术分享图片
?

VS Code 终端设置为Git Bash

原文:https://www.cnblogs.com/remixnameless/p/14826532.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!