From 6dc0da84a7cf9cf46fba226f51daa6ed34870ff4 Mon Sep 17 00:00:00 2001 From: YO4 Date: Wed, 16 Oct 2024 22:21:13 +0900 Subject: [PATCH] windows does not support Process.kill("TERM", pid) --- 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 558318cdb..7c1249dd5 100644 --- a/lib/irb/pager.rb +++ b/lib/irb/pager.rb @@ -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