Uses NerdFont's git branch icon so a Nerd patched font is needed (or just remove the $([char]0xe725)
)
Last active
August 16, 2024 13:46
-
-
Save Vendicated/d9b9669ce91e783ab839b4a2b3c6c6c6 to your computer and use it in GitHub Desktop.
Minimal Powershell Prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prompt { | |
Write-Host -ForegroundColor DarkRed -NoNewLine "[" | |
Write-Host -ForegroundColor Yellow -NoNewLine "$env:USERNAME " | |
Write-Host -ForegroundColor DarkMagenta -NoNewLine "$(Get-Location)" | |
$branch = git branch --show-current | |
if ($?) { | |
Write-Host -ForegroundColor DarkGray -NoNewLine " $([char]0xe725) $branch" | |
if (git status --porcelain) { | |
Write-Host -ForegroundColor DarkGray -NoNewLine "*" | |
} | |
} | |
Write-Host -ForegroundColor DarkRed -NoNewLine "]$" | |
return " " | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment