Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 813
Tim Jarvis Avatar asked Jul 17 '12 02:07

Tim Jarvis


1 Answers

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
like image 146
dahlbyk Avatar answered Sep 21 '22 13:09

dahlbyk