Closed
Description
Hi,
Due to the process.isTTY
check, it can happen that colors are not shown in child process when stderr
is piped.
chalk/supports-color#94 (comment) gave an easy solution to fix this problem.
Request: It would be nice if the readme would mention this workaround.
example code from my project, where a worker with the actual server is forked and passed to node repl. Without setting DEBUG_COLORS: 1
, there won't be any colors 😿 .
worker = fork(WORKER_WRAP_PATH, [workerPath], {
stdio: [
/* stdin: */ 0,
/* stdout: */ 'pipe',
/* stderr: */ 'pipe',
'ipc',
],
env: Object.assign({}, process.env, {
DEBUG_COLORS: 1 // without this settings, colors won't be shown
}),
});
worker.stderr.pipe(process.stderr, { end: false });