Skip to content

Commit

Permalink
windows does not support Process.kill("TERM", pid)
Browse files Browse the repository at this point in the history
  • Loading branch information
YO4 committed Oct 16, 2024
1 parent 5151467 commit 16e77a0
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 16e77a0

Please sign in to comment.