summaryrefslogtreecommitdiff
path: root/lib/irb.rb
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-04-01 19:06:10 +0900
committergit <svn-admin@ruby-lang.org>2021-04-02 01:57:44 +0900
commit1ac68bba4ef9e51c383ad9bad21d41a5ec8c0869 (patch)
treefe46c5c7a46fed1f9ff71488c6e1495dfcf16501 /lib/irb.rb
parent8e636bd0de7ccb7cfd17cc3b9b79f3bd05a857fd (diff)
[ruby/irb] SIGINT should raise Interrupt after IRB session
https://github.com/ruby/irb/commit/5832cfe75b
Diffstat (limited to 'lib/irb.rb')
-rw-r--r--lib/irb.rb3
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