18 lines
396 B
PowerShell
18 lines
396 B
PowerShell
function prompt {
|
|
$prompt_str = ""
|
|
|
|
# GIT branch
|
|
$git_prompt = git branch | foreach { if ($_ -match "^\*(.*)"){ $matches[1] } }
|
|
$prompt_str += "$git_prompt || "
|
|
|
|
# Python
|
|
$py_prompt = python --version
|
|
$prompt_str += "$py_prompt || "
|
|
|
|
# short path
|
|
$p = Split-Path -leaf -path (Get-Location)
|
|
$prompt_str += "$p"
|
|
|
|
Write-Host ($prompt_str)
|
|
return ""
|
|
}
|