From d81b3d616ca7901f276b9775106b6c0ba9542001 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 21 Jan 2023 18:21:44 +0100 Subject: [PATCH] Do not send TERM signal on Windows On Windows, the TERM signal is not supported. Just skip it for now. --- lib/aruba/platforms/unix_platform.rb | 4 ++++ lib/aruba/platforms/windows_platform.rb | 4 ++++ lib/aruba/processes/spawn_process.rb | 6 ++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/aruba/platforms/unix_platform.rb b/lib/aruba/platforms/unix_platform.rb index 5e96de868..88414e7fb 100644 --- a/lib/aruba/platforms/unix_platform.rb +++ b/lib/aruba/platforms/unix_platform.rb @@ -241,6 +241,10 @@ def which(program, path = ENV["PATH"]) def builtin_shell_commands [] end + + def term_signal_supported? + true + end end end end diff --git a/lib/aruba/platforms/windows_platform.rb b/lib/aruba/platforms/windows_platform.rb index c6bb35a51..c4c85f268 100644 --- a/lib/aruba/platforms/windows_platform.rb +++ b/lib/aruba/platforms/windows_platform.rb @@ -39,6 +39,10 @@ def which(program, path = ENV["PATH"]) def builtin_shell_commands %w(cd dir echo exit set type) end + + def term_signal_supported? + false + end end end end diff --git a/lib/aruba/processes/spawn_process.rb b/lib/aruba/processes/spawn_process.rb index e6e064f0c..db807f481 100644 --- a/lib/aruba/processes/spawn_process.rb +++ b/lib/aruba/processes/spawn_process.rb @@ -38,8 +38,10 @@ def stdin def stop return if @exit_status - send_signal "TERM" - return if poll_for_exit(3) + if Aruba.platform.term_signal_supported? + send_signal "TERM" + return if poll_for_exit(3) + end send_signal "KILL" wait