From ed06f018bdffe9bb7f8bdbf15fa5a727e402bfe9 Mon Sep 17 00:00:00 2001 From: YO4 Date: Tue, 5 Nov 2024 22:53:36 +0900 Subject: [PATCH] [ruby/irb] windows does not support Process.kill("TERM", pid) (https://github.com/ruby/irb/pull/1026) https://github.com/ruby/irb/commit/7bbb885163 --- lib/irb/pager.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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