summaryrefslogtreecommitdiffstats
path: root/src/init
diff options
context:
space:
mode:
authorDavid Knaack <davidkna@users.noreply.github.com>2020-08-20 06:45:10 +0200
committerGitHub <noreply@github.com>2020-08-19 23:45:10 -0500
commitd4515696a406352b4973447458ad1caab970adfd (patch)
tree28c0a8a7ad82a8c298a8762ee2d6e2161556f9b1 /src/init
parent09672eeea74652d8e3ad43e08355aa918f6a2fc5 (diff)
fix(pwsh): stop paths from being interpreted as patterns (#1569)
Convert-Path in the powershell prompt script works with -Path, which interprets paths as wildcard patterns. Not all valid paths are also valid wildcard patterns, possibly causing the prompt to error (eg []*). Replace it with -LiteralPath that makes Convert-Path use the path as-is.
Diffstat (limited to 'src/init')
-rw-r--r--src/init/starship.ps12
1 files changed, 1 insertions, 1 deletions
diff --git a/src/init/starship.ps1 b/src/init/starship.ps1
index 15b8a3598..87cef7c6b 100644
--- a/src/init/starship.ps1
+++ b/src/init/starship.ps1
@@ -8,7 +8,7 @@ function global:prompt {
$jobs = @(Get-Job | Where-Object { $_.State -eq 'Running' }).Count
$env:PWD = $PWD
- $current_directory = (Convert-Path $PWD)
+ $current_directory = (Convert-Path -LiteralPath $PWD)
if ($lastCmd = Get-History -Count 1) {
$duration = [math]::Round(($lastCmd.EndExecutionTime - $lastCmd.StartExecutionTime).TotalMilliseconds)