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.
This commit is contained in:
Tian Jian 2021-10-05 23:55:40 +08:00 committed by GitHub
parent 8a4ed5a2e0
commit 59f667ec14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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"],
})
}