-
Notifications
You must be signed in to change notification settings - Fork 32
Description
This code
PowerLine/Source/Public/Write-PowerlinePrompt.ps1
Lines 206 to 209 in 1f5eb7e
| $line += ([PoshCode.Pansies.Text]@{ | |
| Object = "$([char]27)[49m$ColorSeparator&Clear;" | |
| ForegroundColor = $LastBackground | |
| }) |
add a final $ColorSeparator to the generated line. This works well when the last prompt has a background color like those displayed in the readme.
However, I like keeping all of my colors up top and print a null background for the last item on the prompt array.
I'm explicitly setting $Null colors to allow this.
Set-PowerLinePrompt -Colors $Null, NullHowever, if a $ColorSeparator is added on the end, it appears as though the text is rendered with some other background color. This is the effect.
I can't seem to find a public way to alter this separator's background color. To achieve the working screenshot I showed above where the background color of the separator is clear, I added a wrapper to check the last background:
if ($Null -ne $LastBackground) {
$line += ([PoshCode.Pansies.Text]@{
Object = "$([char]27)[49m$ColorSeparator&Clear;"
ForegroundColor = $LastBackground
})
}which works because the final block sets $LastBackground.
Is there a better, public way to control this last separator?

