Skip to content

Commit a41ac67

Browse files
committed
fix: PowerShell not working properly with usernames having Unicode characters
1 parent dd48c7f commit a41ac67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/platform/shell/node/shellEnv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ async function doResolveShellEnv(logService: ILogService, token: CancellationTok
139139
// Older versions of PowerShell removes double quotes sometimes
140140
// so we use "double single quotes" which is how you escape single
141141
// quotes inside of a single quoted string.
142-
command = `Write-Output '${mark}'; [System.Environment]::GetEnvironmentVariables() | ConvertTo-Json -Compress; Write-Output '${mark}'`;
142+
command = `chcp 65001; Write-Output '${mark}'; [System.Environment]::GetEnvironmentVariables() | ConvertTo-Json -Compress; Write-Output '${mark}'`;
143143

144144
// -Login is not a supported argument on PowerShell 5, which is a version of
145145
// powershell that is exclusive to Windows. Providing it would error. Also,

0 commit comments

Comments
 (0)