aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline/line_editor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/reline/line_editor.rb')
-rw-r--r--lib/reline/line_editor.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 6257331886..97f12116b9 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -158,8 +158,16 @@ class Reline::LineEditor
end
Reline::IOGate.move_cursor_column(0)
scroll_down(1)
- @old_trap.call if @old_trap.respond_to?(:call) # can also be string, ex: "DEFAULT"
- raise Interrupt
+ case @old_trap
+ when 'DEFAULT', 'SYSTEM_DEFAULT'
+ raise Interrupt
+ when 'IGNORE'
+ # Do nothing
+ when 'EXIT'
+ exit
+ else
+ @old_trap.call
+ end
}
Reline::IOGate.set_winch_handler do
@rest_height = (Reline::IOGate.get_screen_size.first - 1) - Reline::IOGate.cursor_pos.y