为什么在powershell和posh git中没有黄色

Tim*_*vis 9 git powershell posh-git

好的,所以在git bash这个cmd ..

git log --pretty='%C(yellow)%h%Creset %s' --abbrev-commit
Run Code Online (Sandbox Code Playgroud)

给我一个黄色提交ID和白色主题行,但在powershell(与posh git)我没有黄色提交ID(它是默认的白色).

为什么?

dah*_*byk 10

事实证明,PowerShell的控制台渲染System.ConsoleColor.DarkYellow为白色:

[Enum]::GetValues([ConsoleColor]) | %{ Write-Host $_ -ForegroundColor $_ }
Run Code Online (Sandbox Code Playgroud)

bold yellow相反,使用,渲染System.ConsoleColor.Yellow,工作:

git log --pretty='%C(bold yellow)%h%Creset %s' --abbrev-commit
Run Code Online (Sandbox Code Playgroud)

  • 如何永久性地改变黄色git黄色? (3认同)