From d4515696a406352b4973447458ad1caab970adfd Mon Sep 17 00:00:00 2001 From: David Knaack Date: Thu, 20 Aug 2020 06:45:10 +0200 Subject: [PATCH] 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. --- src/init/starship.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init/starship.ps1 b/src/init/starship.ps1 index 15b8a359..87cef7c6 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)