[ruby/irb] windows does not support Process.kill("TERM", pid)

(https://github.com/ruby/irb/pull/1026)

https://github.com/ruby/irb/commit/7bbb885163
This commit is contained in:
YO4 2024-11-05 22:53:36 +09:00 committed by git
parent e440268d51
commit ed06f018bd

View File

@ -34,7 +34,12 @@ module IRB
# So to properly terminate the pager with Ctrl-C, we need to catch `IRB::Abort` and kill the pager process
rescue IRB::Abort
begin
Process.kill("TERM", pid) if pid
begin
Process.kill("TERM", pid) if pid
rescue Errno::EINVAL
# SIGTERM not supported (windows)
Process.kill("KILL", pid)
end
rescue Errno::ESRCH
# Pager process already terminated
end