Skip to content

Commit

Permalink
Do not send TERM signal on Windows
Browse files Browse the repository at this point in the history
On Windows, the TERM signal is not supported. Just skip it for now.
  • Loading branch information
mvz committed Jan 21, 2023
1 parent ba9b147 commit d81b3d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/aruba/platforms/unix_platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ def which(program, path = ENV["PATH"])
def builtin_shell_commands
[]
end

def term_signal_supported?
true
end
end
end
end
4 changes: 4 additions & 0 deletions lib/aruba/platforms/windows_platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions lib/aruba/processes/spawn_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d81b3d6

Please sign in to comment.