Skip to content

Commit 94ba759

Browse files
committed
second attempt
Props Gemini CLI
1 parent d1aada2 commit 94ba759

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Context/FeatureContext.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ public function afterScenario( AfterScenarioScope $scope ): void {
764764
*/
765765
private static function terminate_proc( $master_pid ): void {
766766
if ( Utils\is_windows() ) {
767-
proc_close( proc_open( "taskkill /F /T /PID $master_pid", [], $pipes ) );
767+
shell_exec( "taskkill /F /T /PID $master_pid > NUL 2>&1" );
768768
return;
769769
}
770770

@@ -781,6 +781,10 @@ private static function terminate_proc( $master_pid ): void {
781781
}
782782
}
783783

784+
if ( ! function_exists( 'posix_kill' ) ) {
785+
return;
786+
}
787+
784788
if ( ! posix_kill( (int) $master_pid, 9 ) ) {
785789
$errno = posix_get_last_error();
786790
// Ignore "No such process" error as that's what we want.

0 commit comments

Comments
 (0)