Created
June 28, 2015 23:12
-
-
Save AKuederle/507f4d9a2fa00037ca69 to your computer and use it in GitHub Desktop.
Overwrite of powershell promt which works with gitposh and provides last argument and last command varibales
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 global:prompt { | |
$realLASTEXITCODE = $LASTEXITCODE | |
$global:l = "$($(Get-History)[-1])" | |
$temp = "$($(Get-History)[-1])" -split " " | |
$global:lc = $temp[0] | |
$global:lp = $temp[1..($temp.length-1)] | |
# Reset color, which can be messed up by Enable-GitColors | |
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor | |
Write-Host($(Split-Path $pwd -Leaf)) -nonewline -foregroundcolor Blue | |
Write-VcsStatus | |
$global:LASTEXITCODE = $realLASTEXITCODE | |
return " $ " | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment