Skip to content

Commit

Permalink
Basic prompt colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ninmonkey committed Mar 30, 2024
1 parent 11bb7cd commit b3cedd8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Pwsh/Formatting/BasicPromptColors.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

# your prompt can do anything that returns a single string
# multiline prompts work
# using this pattern ensures you return one string
function Prompt {
@(
'User> '
) -join ''
}

function Prompt {
# using Pwsh7's builtin functions on $PSStyle for color
$C = @{
FgRed = '#ce6060'
FgPath = '#a9cea7'
}
@(
if( $error.count -gt 0 ) {
$PSStyle.Foreground.FromRgb( $c.FgRed )
$Error.count
$PSStyle.Reset
' '
}

$PSStyle.Foreground.FromRgb( $c.FgPath )
(Get-Location) -split '\\' | Select -Last 3 | Join-String -sep ' > '
$PSStyle.Reset
"`n🐒> "

) -join ''
}

0 comments on commit b3cedd8

Please sign in to comment.