From 9ffd4d86ee29cf66c8c9bb29c4431e7b5d827125 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Thu, 7 Nov 2019 10:35:56 +0700 Subject: [PATCH] spawn: Use explicit chcp.com (#910) Using only `chcp` relies on the setting of environment variable PATHEXT. Related to https://github.com/microsoft/vscode-arduino/issues/869 --- src/common/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/util.ts b/src/common/util.ts index 660c8a87..2af4b83b 100644 --- a/src/common/util.ts +++ b/src/common/util.ts @@ -210,10 +210,10 @@ export function spawn(command: string, outputChannel: vscode.OutputChannel, args let codepage = "65001"; if (os.platform() === "win32") { try { - const chcp = childProcess.execSync("chcp"); + const chcp = childProcess.execSync("chcp.com"); codepage = chcp.toString().split(":").pop().trim(); } catch (error) { - arduinoChannel.warning(`Defaulting to code page 850 because chcp failed.\ + arduinoChannel.warning(`Defaulting to code page 850 because chcp.com failed.\ \rEnsure your path includes %SystemRoot%\\system32\r${error.message}`); codepage = "850"; }