From 59f667ec146abef3839a80d2117fb616bc51a59d Mon Sep 17 00:00:00 2001 From: Tian Jian Date: Tue, 5 Oct 2021 23:55:40 +0800 Subject: [PATCH] Fix: use pipe to spawn child process to re-enable file logging (#4293) We pipe the child's stdout and stderr to the log file (and to the parent's streams) but since we used `inherit` for `stdio` this caused the child to use the parent's streams directly which made `child.stdout` and `child.stderr` non-existent and thus we had no file logging. Using `pipe` creates stdin and stderr on the child. --- src/node/wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/wrapper.ts b/src/node/wrapper.ts index 8e8d9ccab..c645fe835 100644 --- a/src/node/wrapper.ts +++ b/src/node/wrapper.ts @@ -314,7 +314,7 @@ export class ParentProcess extends Process { CODE_SERVER_PARENT_PID: process.pid.toString(), NODE_OPTIONS: `--max-old-space-size=2048 ${process.env.NODE_OPTIONS || ""}`, }, - stdio: ["inherit", "inherit", "inherit", "ipc"], + stdio: ["pipe", "pipe", "pipe", "ipc"], }) }