Skip to content

Commit 961cd83

Browse files
committed
shellIntegration.ps1: give escaping method a private name
1 parent 859f16a commit 961cd83

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") {
1616
$Global:__VSCodeOriginalPrompt = $function:Prompt
1717

1818
$Global:__LastHistoryId = -1
19-
function Set-Serialized {
20-
param ([string] $toSerialize)
21-
$toSerialize = $toSerialize.Replace("\", "\\").Replace("`n", "\x0a").Replace(";", "\x3b")
22-
return $toSerialize
19+
20+
function Global:__VSCode-Escape-Value([string]$value) {
21+
$value.Replace("\", "\\").Replace("`n", "\x0a").Replace(";", "\x3b")
2322
}
2423

2524
function Global:Prompt() {
@@ -43,7 +42,7 @@ function Global:Prompt() {
4342
} else {
4443
$CommandLine = ""
4544
}
46-
$Result += Set-Serialized($CommandLine)
45+
$Result += $(__VSCode-Escape-Value $CommandLine)
4746
$Result += "`a"
4847
# Command finished exit code
4948
# OSC 633 ; D [; <ExitCode>] ST

0 commit comments

Comments
 (0)