PoshCode / Pansies

Powershell ANSI Escape Sequences, functions for colored output, etc.
MIT License
148 stars 14 forks source link

Should be able to get default colors easily #3

Closed Jaykul closed 7 years ago

Jaykul commented 7 years ago

To get this prompt:

I 💟 PS>

I want to be able to write:

function prompt { "I" + [TextSpan]@{ fg = "Red"; text = [char]0x2665 } + "PS>"}

But currently, the Background is required:

function prompt { "I" + [TextSpan]@{ bg = "Black"; fg = "Red"; text = [char]0x2665 } + "PS>"}

And the color doesn't reset, so PS> comes out red unless I manually call GetString, like:

function prompt { "I" + [TextSpan]::GetString("Red","Black",([char]0x2665),$true) + "PS>"}
Jaykul commented 7 years ago

Fixed in 56176d7