Skip to content

Commit b841162

Browse files
committed
Encode all chars 0x00-0x1f
Fixes microsoft#211922
1 parent 2e970c7 commit b841162

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if ($env:VSCODE_ENV_APPEND) {
5252
function Global:__VSCode-Escape-Value([string]$value) {
5353
# NOTE: In PowerShell v6.1+, this can be written `$value -replace '…', { … }` instead of `[regex]::Replace`.
5454
# Replace any non-alphanumeric characters.
55-
[regex]::Replace($value, "[$([char]0x1b)\\\n;]", { param($match)
55+
[regex]::Replace($value, "[$([char]0x00)-$([char]0x1f)\\\n;]", { param($match)
5656
# Encode the (ascii) matches as `\x<hex>`
5757
-Join (
5858
[System.Text.Encoding]::UTF8.GetBytes($match.Value) | ForEach-Object { '\x{0:x2}' -f $_ }

0 commit comments

Comments
 (0)