File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ else {
38
38
$poshGitPromptScriptBlock = $null
39
39
40
40
$currentPromptDef = if ($funcInfo = Get-Command prompt - ErrorAction SilentlyContinue) { $funcInfo.Definition }
41
+
42
+ # If prompt matches pre-0.7 posh-git prompt, ignore it
43
+ $collapsedLegacyPrompt = ' $realLASTEXITCODE = $LASTEXITCODE;Write-Host($pwd.ProviderPath) -nonewline;Write-VcsStatus;$global:LASTEXITCODE = $realLASTEXITCODE;return "> "'
44
+ if ($currentPromptDef -and (($collapsedLegacyPrompt.Trim () -replace ' [\r\n\t]+\s*' , ' ;' ) -eq $collapsedLegacyPrompt )) {
45
+ Write-Warning ' Replacing old posh-git prompt. Did you copy profile.example.ps1 into $PROFILE?'
46
+ $currentPromptDef = $null
47
+ }
48
+
41
49
if (! $currentPromptDef ) {
42
50
# HACK: If prompt is missing, create a global one we can overwrite with Set-Item
43
51
function global :prompt { ' ' }
You can’t perform that action at this time.
0 commit comments