Skip to content

Commit 42c2cfc

Browse files
authored
fix(pipe): sort out pipes on platforms (#895)
1 parent 0ed43e8 commit 42c2cfc

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/server/processLauncher.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@ let lastLaunchedId = 0;
4949

5050
export async function launchProcess(options: LaunchProcessOptions): Promise<LaunchResult> {
5151
const id = ++lastLaunchedId;
52-
let stdio: ('ignore' | 'pipe')[] = ['pipe', 'pipe', 'pipe'];
53-
if (options.pipe) {
54-
if (options.dumpio)
55-
stdio = ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'];
56-
else
57-
stdio = ['ignore', 'ignore', 'ignore', 'pipe', 'pipe'];
58-
}
52+
const stdio: ('ignore' | 'pipe')[] = options.pipe ? ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'] : ['ignore', 'pipe', 'pipe'];
5953
const spawnedProcess = childProcess.spawn(
6054
options.executablePath,
6155
options.args,
@@ -80,8 +74,11 @@ export async function launchProcess(options: LaunchProcessOptions): Promise<Laun
8074
}
8175

8276
if (options.dumpio) {
83-
spawnedProcess.stderr.pipe(process.stderr);
8477
spawnedProcess.stdout.pipe(process.stdout);
78+
spawnedProcess.stderr.pipe(process.stderr);
79+
} else {
80+
spawnedProcess.stderr.on('data', () => {});
81+
spawnedProcess.stdout.on('data', () => {});
8582
}
8683

8784
let processClosed = false;

0 commit comments

Comments
 (0)