From 52e090b4da1690ba628fe41fdde199dac3d06789 Mon Sep 17 00:00:00 2001 From: Anton Kosyakov Date: Fri, 18 Jun 2021 07:00:02 +0000 Subject: [PATCH] [server] ignore stderr while resolving shell env see https://github.com/gitpod-io/gitpod/issues/4460#issuecomment-863799213 for motivation --- src/vs/platform/environment/node/shellEnv.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/vs/platform/environment/node/shellEnv.ts b/src/vs/platform/environment/node/shellEnv.ts index 091bb7e5d38f09..c7528d32677704 100644 --- a/src/vs/platform/environment/node/shellEnv.ts +++ b/src/vs/platform/environment/node/shellEnv.ts @@ -97,7 +97,8 @@ async function doResolveUnixShellEnv(logService: ILogService): Promise buffers.push(b)); - - const stderr: Buffer[] = []; - child.stderr.on('data', b => stderr.push(b)); + child.stdout.on('data', b => { + logService.trace('getUnixShellEnvironment#stdoutData', b.toString('utf8')); + buffers.push(b); + }); child.on('close', (code, signal) => { + logService.trace('getUnixShellEnvironment#close', code, signal); + const raw = Buffer.concat(buffers).toString('utf8'); logService.trace('getUnixShellEnvironment#raw', raw); - const stderrStr = Buffer.concat(stderr).toString('utf8'); - if (stderrStr.trim()) { - logService.trace('getUnixShellEnvironment#stderr', stderrStr); - } - if (code || signal) { return reject(new Error(`Failed to get environment (code ${code}, signal ${signal})`)); }