简体   繁体   English

为什么我的集成VS Code Bash终端不使用bash着色?

[英]Why doesn't my integrated VS Code Bash terminal use bash coloring?

When I'm using VS Code's integrated bash terminal I don't have any of the normal bash coloring schemes, all of my text is simply white.当我使用 VS Code 的集成 bash 终端时,我没有任何正常的 bash 着色方案,我所有的文字都是白色的。 If I use git bash outside of VS Code, I get all of the normal directory colorings.如果我在 VS Code 之外使用 git bash,我会得到所有正常的目录颜色。

I tried the accepted answer here as well as the others mentioned in the same post but nothing worked.我在这里尝试了接受的答案以及同一篇文章中提到的其他答案,但没有任何效果。 I also made sure to have my bash terminal profile set to the correct exe file but that hasn't worked either.我还确保将我的 bash 终端配置文件设置为正确的 exe 文件,但这也不起作用。 I've also read through VS Code's new documentation on terminal profiles but I think mine is set up correctly.我还阅读了 VS Code 关于终端配置文件的新文档,但我认为我的设置正确。 I don't know what else to check at this point, everything looks to be correct.我不知道此时还要检查什么,一切看起来都是正确的。 Does anybody have any ideas?有人有什么想法吗?

Here are my terminal settings:这是我的终端设置:

    "terminal.integrated.defaultProfile.windows": "Command Prompt",
    "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",
            "icon": "terminal-bash",
            "path": "C:\\Program Files\\Git\\bin\\bash.exe"
        }
    }

Here is a picture showing Git Bash, VS Code's settings, and my VS Code Bash terminal.这是显示 Git Bash、VS Code 的设置和我的 VS Code Bash 终端的图片。

Bash inside VSC: VSC 内的 Bash:

$ echo $COLORTERM
truecolor
$ echo $PS1
\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$
$ echo $TERM
xterm-256color

Bash outside VSC: Bash 在 VSC 外:

$ echo $COLORTERM

$ echo $PS1
\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$
$ echo $TERM
xterm

I got it working!我让它工作了! I took @joanis's advice and started resetting chunks of my VSC settings and narrowed it down to the Minimum Contrast Ratio setting.我接受了@joanis 的建议,开始重置我的 VSC 设置块并将其缩小到最小对比度设置。 I don't know why but mine was set at 21. The default is 4. Once I changed mine to 4, the git bash terminal colors showed up!我不知道为什么,但我的设置为 21。默认值为 4。一旦我将我的更改为 4,git bash 终端 colors 出现了!

在此处输入图像描述 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM