summaryrefslogtreecommitdiff
path: root/lib/irb/pager.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/pager.rb')
-rw-r--r--lib/irb/pager.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/irb/pager.rb b/lib/irb/pager.rb
index 558318cdb8..7c1249dd5c 100644
--- a/lib/irb/pager.rb
+++ b/lib/irb/pager.rb
@@ -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