Tim Jarvis
Tim Jarvis

Reputation: 18815

Why no yellow in powershell and posh git

Ok, so in git bash this cmd..

git log --pretty='%C(yellow)%h%Creset %s' --abbrev-commit

gives me a yellow commit id and white subject line, but in powershell (with posh git) I get no yellow commit id (it's the default white).

Why ?

Upvotes: 10

Views: 971

Answers (1)

dahlbyk
dahlbyk

Reputation: 77520

It turns out PowerShell's console renders System.ConsoleColor.DarkYellow as white:

[Enum]::GetValues([ConsoleColor]) | %{ Write-Host $_ -ForegroundColor $_ }

Using bold yellow instead, which renders with System.ConsoleColor.Yellow, works:

git log --pretty='%C(bold yellow)%h%Creset %s' --abbrev-commit

Upvotes: 10

Related Questions