Skip to content

Commit 7bbb885

Browse files
authored
windows does not support Process.kill("TERM", pid) (#1026)
1 parent 7f385bc commit 7bbb885

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/irb/pager.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ def page(retain_content: false)
3434
# So to properly terminate the pager with Ctrl-C, we need to catch `IRB::Abort` and kill the pager process
3535
rescue IRB::Abort
3636
begin
37-
Process.kill("TERM", pid) if pid
37+
begin
38+
Process.kill("TERM", pid) if pid
39+
rescue Errno::EINVAL
40+
# SIGTERM not supported (windows)
41+
Process.kill("KILL", pid)
42+
end
3843
rescue Errno::ESRCH
3944
# Pager process already terminated
4045
end

0 commit comments

Comments
 (0)