Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/studio/src/modules/cli/lib/execute-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,10 @@ export function executeCliCommand(
eventEmitter.emit( 'data', { data: message } );
} );

// Only kills the child; the `close` handler still runs to settle the
// emitter and detach this listener if a prevented quit keeps the app alive.
function appQuitHandler() {
const pid = child.pid;
child.removeAllListeners();

// `child.kill()` only terminates the forked CLI process; on Windows its php.exe descendants
// would orphan and keep their DLLs locked. `taskkill /T` walks the whole tree instead.
Expand Down
3 changes: 2 additions & 1 deletion packages/common/lib/cli-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ export function createCliRunner( config: CliRunnerConfig ): CliRunner {
const { cliBinary, nodeBinary, execArgv = [ '--experimental-wasm-jspi' ], onError } = config;
const liveChildren = new Set< ChildProcess >();

// Only kills the child; its `close` handler still runs so awaiting callers
// see a failure instead of hanging forever.
function killChild( child: ChildProcess ): void {
const pid = child.pid;
child.removeAllListeners();

// `child.kill()` only terminates the forked CLI process; on Windows its
// php.exe descendants would orphan and keep their DLLs locked. `taskkill
Expand Down
Loading