From 66ad45b79a3bc924d6d3bd02165df34ae7f63098 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 1 Jun 2023 10:32:33 +0200 Subject: [PATCH] cli - ignore std error unless verbose (#183787) (#184031) --- src/vs/code/node/cli.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/code/node/cli.ts b/src/vs/code/node/cli.ts index c07a0f238d6..5184fa12bd7 100644 --- a/src/vs/code/node/cli.ts +++ b/src/vs/code/node/cli.ts @@ -414,8 +414,9 @@ export async function main(argv: string[]): Promise { let child: ChildProcess; if (!isMacOSBigSurOrNewer) { if (!verbose && args.status) { - options['stdio'] = 'pipe'; // restore ability to see output when --status is used + options['stdio'] = ['ignore', 'pipe', 'ignore']; // restore ability to see output when --status is used } + // We spawn process.execPath directly child = spawn(process.execPath, argv.slice(2), options); } else { @@ -440,7 +441,7 @@ export async function main(argv: string[]): Promise { // The open command only allows for redirecting stderr and stdout to files, // so we make it redirect those to temp files, and then use a logger to // redirect the file output to the console - for (const outputType of ['stdout', 'stderr']) { + for (const outputType of verbose ? ['stdout', 'stderr'] : ['stdout']) { // Tmp file to target output to const tmpName = randomPath(tmpdir(), `code-${outputType}`);