简体   繁体   中英

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. If I use git bash outside of VS Code, I get all of the normal directory colorings.

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. I've also read through VS Code's new documentation on terminal profiles but I think mine is set up correctly. 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.

Bash inside VSC:

$ 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:

$ 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. 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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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