Skip to content

Commit f1c978d

Browse files
authored
Merge pull request microsoft#210521 from microsoft/tyriar/210353
Only send 633;E nonce when not Windows 10
2 parents 3211128 + aac6f9c commit f1c978d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ $Global:__LastHistoryId = -1
2121
$Nonce = $env:VSCODE_NONCE
2222
$env:VSCODE_NONCE = $null
2323

24+
$osVersion = [System.Environment]::OSVersion.Version
25+
$isWindows10 = $IsWindows10 -and $osVersion.Major -eq 10 -and $osVersion.Minor -eq 0 -and $osVersion.Build -lt 22000
26+
2427
if ($env:VSCODE_ENV_REPLACE) {
2528
$Split = $env:VSCODE_ENV_REPLACE.Split(":")
2629
foreach ($Item in $Split) {
@@ -105,9 +108,12 @@ if (Get-Module -Name PSReadLine) {
105108
# OSC 633 ; E ; <CommandLine?> ; <Nonce?> ST
106109
$Result = "$([char]0x1b)]633;E;"
107110
$Result += $(__VSCode-Escape-Value $CommandLine)
108-
$Result += ";$Nonce"
111+
# Only send the nonce if the OS is not Windows 10 as it seems to echo to the terminal
112+
# sometimes
113+
if ($IsWindows10 -eq $false) {
114+
$Result += ";$Nonce"
115+
}
109116
$Result += "`a"
110-
[Console]::Write($Result)
111117

112118
# Command executed
113119
# OSC 633 ; C ST

0 commit comments

Comments
 (0)