1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

fix issue with 'SIGINT' handling in LineEditor#reset

@old_trap is the string "DEFAULT" and not a callable object (Proc)
if there are no other signal handlers for SIGINT signal to chain.
This commit is contained in:
Luke Gruber 2019-06-08 14:55:41 -04:00 committed by aycabta
parent 47b04557b0
commit 3163a07878

View file

@ -67,7 +67,7 @@ class Reline::LineEditor
@old_trap = Signal.trap('SIGINT') {
scroll_down(@highest_in_all - @first_line_started_from)
Reline::IOGate.move_cursor_column(0)
@old_trap.()
@old_trap.call if @old_trap.respond_to?(:call) # can also be string, ex: "DEFAULT"
}
end