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