diff options
| author | YO4 <ysno@ac.auone-net.jp> | 2024-11-05 22:53:36 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-11-05 13:53:41 +0000 |
| commit | ed06f018bdffe9bb7f8bdbf15fa5a727e402bfe9 (patch) | |
| tree | 05d8e65591eb87decf37c96064573fd62e35e223 /lib | |
| parent | e440268d51fe02b303e3817a7a733a0dac1c5091 (diff) | |
[ruby/irb] windows does not support Process.kill("TERM", pid)
(https://github.com/ruby/irb/pull/1026)
https://github.com/ruby/irb/commit/7bbb885163
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/irb/pager.rb | 7 |
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 |
