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.
This commit is contained in:
parent
09672eeea7
commit
d4515696a4
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue