diff options
Diffstat (limited to 'lib/irb.rb')
-rw-r--r-- | lib/irb.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/irb.rb b/lib/irb.rb index 17d4ae51bd..d914f06a7a 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -65,12 +65,20 @@ module IRB irb.signal_handle end - catch(:IRB_EXIT) do - irb.eval_input + begin + catch(:IRB_EXIT) do + irb.eval_input + end + ensure + irb_at_exit end # print "\n" end + def IRB.irb_at_exit + @CONF[:AT_EXIT].each{|hook| hook.call} + end + def IRB.irb_exit(irb, ret) throw :IRB_EXIT, ret end |