Skip to content

Instantly share code, notes, and snippets.

@Vendicated
Last active February 10, 2023 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vendicated/d9b9669ce91e783ab839b4a2b3c6c6c6 to your computer and use it in GitHub Desktop.
Save Vendicated/d9b9669ce91e783ab839b4a2b3c6c6c6 to your computer and use it in GitHub Desktop.
Minimal Powershell Prompt

image

Uses NerdFont's git branch icon so a Nerd patched font is needed (or just remove the $([char]0xe725))

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