File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/vs/workbench/contrib/terminal/browser/media Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -52,12 +52,17 @@ if ($env:VSCODE_ENV_APPEND) {
52
52
function Global :__VSCode-Escape-Value ([string ]$value ) {
53
53
# NOTE: In PowerShell v6.1+, this can be written `$value -replace '…', { … }` instead of `[regex]::Replace`.
54
54
# Replace any non-alphanumeric characters.
55
- [regex ]::Replace($value , ' [\\\n;]' , { param ($match )
55
+ $Result = [regex ]::Replace($value , ' [\\\n;]' , { param ($match )
56
56
# Encode the (ascii) matches as `\x<hex>`
57
57
-Join (
58
58
[System.Text.Encoding ]::UTF8.GetBytes($match.Value ) | ForEach-Object { ' \x{0:x2}' -f $_ }
59
59
)
60
- }) -replace " `e " , ' \x1b'
60
+ })
61
+ # `e is only availabel in pwsh 6+
62
+ if ($PSVersionTable.PSVersion.Major -lt 6 ) {
63
+ $Result = $Result -replace " `e " , ' \x1b'
64
+ }
65
+ $Result
61
66
}
62
67
63
68
function Global :Prompt () {
You can’t perform that action at this time.
0 commit comments