mirror of https://github.com/coder/code-server.git
fix: output lost after hotswapping (#5346)
I think the pipe was closing the other streams when the child stream closed so instead just write it one way.
This commit is contained in:
parent
714257b3c5
commit
646f2436b0
|
@ -292,14 +292,18 @@ export class ParentProcess extends Process {
|
||||||
const child = this.spawn()
|
const child = this.spawn()
|
||||||
this.child = child
|
this.child = child
|
||||||
|
|
||||||
// Log both to stdout and to the log directory.
|
// Log child output to stdout/stderr and to the log directory.
|
||||||
if (child.stdout) {
|
if (child.stdout) {
|
||||||
child.stdout.pipe(this.logStdoutStream)
|
child.stdout.on("data", (data) => {
|
||||||
child.stdout.pipe(process.stdout)
|
this.logStdoutStream.write(data)
|
||||||
|
process.stdout.write(data)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (child.stderr) {
|
if (child.stderr) {
|
||||||
child.stderr.pipe(this.logStderrStream)
|
child.stderr.on("data", (data) => {
|
||||||
child.stderr.pipe(process.stderr)
|
this.logStderrStream.write(data)
|
||||||
|
process.stderr.write(data)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.debug(`spawned inner process ${child.pid}`)
|
this.logger.debug(`spawned inner process ${child.pid}`)
|
||||||
|
|
Loading…
Reference in New Issue