Skip to content

Commit 3079ca3

Browse files
authored
Merge pull request microsoft#226976 from microsoft/tyriar/222237_3
Use OS separator when injecting ../ completion
2 parents d33446f + ee83a4c commit 3079ca3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,9 @@ function Send-Completions {
388388
if ($completions.CompletionMatches.Count -gt 0 -and $completions.CompletionMatches.Where({ $_.ResultType -eq 3 -or $_.ResultType -eq 4 })) {
389389
# Add `../ relative to the top completion
390390
$firstCompletion = $completions.CompletionMatches[0]
391-
if ($firstCompletion.CompletionText.StartsWith('../')) {
392-
if ($completionPrefix -match '(\.\.\/)+') {
393-
$parentDir = "$($matches[0])../"
391+
if ($firstCompletion.CompletionText.StartsWith("..$([System.IO.Path]::DirectorySeparatorChar)")) {
392+
if ($completionPrefix -match "(\.\.$([System.IO.Path]::DirectorySeparatorChar))+") {
393+
$parentDir = "$($matches[0])..$([System.IO.Path]::DirectorySeparatorChar)"
394394
$currentPath = Split-Path -Parent $firstCompletion.ToolTip
395395
try {
396396
$parentDirPath = Split-Path -Parent $currentPath

0 commit comments

Comments
 (0)