diff --git a/src/GitPrompt.ps1 b/src/GitPrompt.ps1 index 6d9184380..001c0f642 100644 --- a/src/GitPrompt.ps1 +++ b/src/GitPrompt.ps1 @@ -100,6 +100,7 @@ $global:GitPromptSettings = [pscustomobject]@{ DefaultPromptSuffix = '$(''>'' * ($nestedPromptLevel + 1)) ' DefaultPromptDebugSuffix = ' [DBG]$(''>'' * ($nestedPromptLevel + 1)) ' DefaultPromptEnableTiming = $false + DefaultPromptAbbreviateHomeDirectory = $false Debug = $false diff --git a/src/posh-git.psm1 b/src/posh-git.psm1 index c58a14e44..1d6ca41fe 100644 --- a/src/posh-git.psm1 +++ b/src/posh-git.psm1 @@ -66,7 +66,7 @@ if (!$currentPromptDef -or ($currentPromptDef -eq $defaultPromptDef)) { } # Abbreviate path by replacing beginning of path with ~ *iff* the path is in the user's home dir - if ($currentPath -and $currentPath.StartsWith($Home, $stringComparison)) + if ($GitPromptSettings.DefaultPromptAbbreviateHomeDirectory -and $currentPath -and $currentPath.StartsWith($Home, $stringComparison)) { $currentPath = "~" + $currentPath.SubString($Home.Length) }