VSCode 设置git bash终端

背景:

vscode 只有 PowerShell 和 Command Prompt。这让人很不舒适,于是网上搜罗了一番了,可惜都是些陈芝麻烂谷子,没一个能用的。

流程:   

  文件 》 首选项 》 设置

  1、在搜索框中搜索:terminal.integrated.profiles.windows

 

 

 

点击下方:在 settings.json 中编辑,进入到 settings.json 文件

内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
    "security.workspace.trust.untrustedFiles": "open",
    "editor.formatOnSave": true,
    "[go]": {
        "editor.formatOnSave": false,
        "editor.formatOnType": false
    },
    "go.toolsManagement.autoUpdate": 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"
        }
    },
    "terminal.integrated.defaultProfile.windows": "GitBash"
}

之后将终端配置写进去。

注意:

"terminal.integrated.defaultProfile.windows": "GitBash"

PS:

  1、这一条设置后,就会在打开终端后,默认使用 bash 作为终端了。

  2、Git Bash 的路径请填你自己电脑上 bash.exe 的位置。

最后,务必重启 VSCode 编辑器,然后打开终端重试即可。



如图:

 

 

posted @   萤huo虫  阅读(1647)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示