Skip to content

Commit 480485f

Browse files
authored
Merge pull request microsoft#251534 from liuxingbaoyu/fix-251478
fix: PowerShell not working with username having Unicode
2 parents 01fbd91 + a41ac67 commit 480485f

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)