Skip to content

Commit

Permalink
windows does not support Process.kill("TERM", pid) (#1026)
Browse files Browse the repository at this point in the history
  • Loading branch information
YO4 authored Nov 5, 2024
1 parent 7f385bc commit 7bbb885
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/irb/pager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ def page(retain_content: false)
# 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
Expand Down

0 comments on commit 7bbb885

Please sign in to comment.