@@ -3,7 +3,7 @@ const DEV_MODE = process.env.HTK_DEV === 'true';
33// Set up error handling before everything else:
44import { logError , addBreadcrumb } from './errors.ts' ;
55
6- import { spawn , ChildProcess } from 'child_process' ;
6+ import { spawn , ChildProcess , execSync } from 'child_process' ;
77import * as os from 'os' ;
88import { promises as fs , createWriteStream , WriteStream } from 'fs'
99import * as net from 'net' ;
@@ -154,6 +154,11 @@ if (!amMainInstance) {
154154 console . log ( 'Failed to kill server' , error ) ;
155155 logError ( error ) ;
156156 } finally {
157+ // Log at exit
158+ execSync ( 'ps xao pid,ppid,pgid,cmd --forest' , {
159+ stdio : 'inherit'
160+ } ) ;
161+
157162 if ( process . stdin ) process . stdin . destroy ( ) ;
158163 if ( process . stdout ) process . stdout . destroy ( ) ;
159164 if ( process . stderr ) process . stderr . destroy ( ) ;
@@ -370,6 +375,11 @@ if (!amMainInstance) {
370375 }
371376
372377 async function startServer ( retries = 2 ) {
378+ await delay ( 100 ) ;
379+ execSync ( 'ps xao pid,ppid,pgid,cmd --forest' , {
380+ stdio : 'inherit'
381+ } ) ;
382+
373383 logStream . write ( 'Starting server\n' ) ;
374384 const binName = isWindows ? 'httptoolkit-server.cmd' : 'httptoolkit-server' ;
375385 const serverBinPath = path . join ( RESOURCES_PATH , 'httptoolkit-server' , 'bin' , binName ) ;
0 commit comments