diff options
author | Koichi Sasada <[email protected]> | 2021-04-01 19:06:10 +0900 |
---|---|---|
committer | git <[email protected]> | 2021-04-02 01:57:44 +0900 |
commit | 1ac68bba4ef9e51c383ad9bad21d41a5ec8c0869 (patch) | |
tree | fe46c5c7a46fed1f9ff71488c6e1495dfcf16501 /lib | |
parent | 8e636bd0de7ccb7cfd17cc3b9b79f3bd05a857fd (diff) |
[ruby/irb] SIGINT should raise Interrupt after IRB session
https://github.com/ruby/irb/commit/5832cfe75b
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/irb.rb b/lib/irb.rb index 5a2aed0353..93c4d25c92 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -472,7 +472,7 @@ module IRB conf[:IRB_RC].call(context) if conf[:IRB_RC] conf[:MAIN_CONTEXT] = context - trap("SIGINT") do + prev_trap = trap("SIGINT") do signal_handle end @@ -481,6 +481,7 @@ module IRB eval_input end ensure + trap("SIGINT", prev_trap) conf[:AT_EXIT].each{|hook| hook.call} end end |