@@ -348,7 +348,8 @@ exec bash -c "
348348 try {
349349 // On Unix systems, negative PID kills the process group
350350 this . logger . debug ( `Sending SIGTERM to process group -${ this . childProcess . pid } ` )
351- process . kill ( - this . childProcess . pid , 'SIGTERM' )
351+ const pid = - this . childProcess . pid
352+ process . kill ( pid , 'SIGTERM' )
352353 } catch ( err ) {
353354 this . logger . debug ( `Failed to kill process group: ${ err } ` )
354355 // Fall back to regular process termination
@@ -367,7 +368,8 @@ exec bash -c "
367368 if ( this . childProcess . pid ) {
368369 try {
369370 this . logger . debug ( `Sending SIGKILL to process group -${ this . childProcess . pid } ` )
370- process . kill ( - this . childProcess . pid , 'SIGKILL' )
371+ const pid = - this . childProcess . pid
372+ process . kill ( pid , 'SIGKILL' )
371373 } catch ( err ) {
372374 this . logger . debug ( `Failed to kill process group with SIGKILL: ${ err } ` )
373375 // Fall back to regular process termination
@@ -385,7 +387,6 @@ exec bash -c "
385387
386388 // Return from the function after cancellation
387389 reject ( new Error ( 'Command execution cancelled' ) )
388- console . log ( 'exiting the cancellation' )
389390 return
390391 }
391392 } , 100 ) // Check every 100ms
0 commit comments