=Fixed styling error on load

This commit is contained in:
Gal Szkolnik 2021-10-12 01:31:28 -04:00
parent 57286b546c
commit a2888a883b
2 changed files with 43 additions and 13 deletions

View File

@ -5,19 +5,34 @@ $local:MyPowerLineSetup = [ordered]@{
SetCurrentDirectory = $true
RestoreVirtualTerminal = $true
PowerLineCharacters = [ordered]@{
ColorSeparator = "$([char]::ConvertFromUtf32(0x2588)
)$([PoshCode.Pansies.Entities]::ExtendedCharacters.ColorSeparator.Trim()[-1]) "
ReverseColorSeparator = " $(
[PoshCode.Pansies.Entities]::ExtendedCharacters.ReverseColorSeparator.Trim()[0]
)$([char]::ConvertFromUtf32(0x2588))"
# Separator = " $([PoshCode.Pansies.Entities]::ExtendedCharacters.Separator.Trim()[-1]) "
Separator = "$([PoshCode.Pansies.Entities]::NerdFonts['nf-fa-angle_right'])"
ReverseSeparator = " $(
[PoshCode.Pansies.Entities]::ExtendedCharacters.ReverseSeparator.Trim()[0]) "
ColorSeparator = "$(
$PromptCache.ColorFiller
)$( $PromptCache.Separator.Trim()
)$( " "
)"
ReverseColorSeparator = "$(
" "
)$( $PromptCache.ReverseSeparator.Trim()
)$( $PromptCache.ColorFiller
)"
Separator = $(
[PoshCode.Pansies.Entities]::NerdFonts['nf-fa-angle_right']
)
ReverseSeparator = $(
[PoshCode.Pansies.Entities]::NerdFonts['nf-fa-angle_left']
)
}
Colors = @( [rgbcolor]"Grey18", [rgbcolor]"Grey65" ) #, [rgbcolor]"white", [rgbcolor]"red", [rgbcolor]"blue" )
Colors = [PoshCode.Pansies.RgbColor]::X11Palette |
Where-Object X11ColorName -match "^Gray\d" |
Sort-Object X11ColorName -Unique |
Where-Object {
0 -eq $([int]($_.X11ColorName -replace 'Gray','') % 11)
}
#@( [rgbcolor]"Grey18", [rgbcolor]"Grey65" )
#([rgbcolor]::ConsolePalette | Where ConsoleColor -eq ((get-host).ui.rawui.BackgroundColor)),
#@( [rgbcolor]"Grey18", [rgbcolor]"Grey65" ) #, [rgbcolor]"white", [rgbcolor]"red", [rgbcolor]"blue" )
Prompt = @(
{ "`n" } # A spaced line
{ Write-Host "" } # A spaced line without a ColorSeparator
{ New-PromptText -EBg VioletRed4 $MyInvocation.HistoryId }
{ Get-SegmentedPath -LengthLimit 30 }
{ Write-VcsStatus }
@ -31,7 +46,7 @@ $local:MyPowerLineSetup = [ordered]@{
{ "$PSOSName " }
{ "`n" }
{ New-PromptText { "PS" } -Ebg Red }
{ New-PromptText { "PS" } -Bg $Prompt.Colors[1] -Ebg Red }
)
}
Set-PowerLinePrompt @MyPowerLineSetup

View File

@ -17,7 +17,7 @@ Get-Command -ListImported Get-GitDirectory -ErrorAction Ignore |
$local:g = $global:GitPromptSettings
$g.WorkingColor.ForegroundColor = [System.ConsoleColor]::DarkYellow
$g.TruncatedBranchSuffix = [char]0x2026
$g.PathStatusSeparator = [PoshCode.Pansies.Entities]::ExtendedCharacters.Branch
$g.PathStatusSeparator = "$([char]0xE0A0)" #[PoshCode.Pansies.Entities]::ExtendedCharacters.Branch
$g.BeforeStatus.Text = [string]::Empty
$g.AfterStatus.Text = [string]::Empty
$g.BranchGoneStatusSymbol.Text = [char]0x2262
@ -37,6 +37,21 @@ if( (Get-Command -ListImported Set-PowerLinePrompt -ErrorAction Ignore) ) {
OSName = [SystemName]::_GetValidValues("",$true,$true) | Select-Object -First 1
Username = @($env:USER, $env:USERNAME -ne "")[0]
Hostname = $(hostname).Trim()
ColorFiller = $([char]0x2588)
Separator = " $(
[PoshCode.Pansies.Entities]::NerdFonts['nf-pl-left_hard_divider']
)"
ReverseSeparator = "$(
[PoshCode.Pansies.Entities]::NerdFonts['nf-pl-right_hard_divider']
) "
# Separator = "$(
# [char]::ConvertFromUtf32(0x2588)
# )$( [PoshCode.Pansies.Entities]::ExtendedCharacters.ColorSeparator.Trim()[-1]
# ) "
# ReverseSeparator = " $(
# [PoshCode.Pansies.Entities]::ExtendedCharacters.ColorSeparator.Trim()[0]
# )$( [char]::ConvertFromUtf32(0x2588))"
}
Set-PowerLinePrompt