From 9d95ae8411a28c79eee9b310de9edfae1047018b Mon Sep 17 00:00:00 2001 From: Luke Gruber Date: Sat, 8 Jun 2019 14:55:41 -0400 Subject: [PATCH] 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. --- lib/reline/line_editor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index c5f00c28dc..bcad686311 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -64,7 +64,7 @@ def reset(prompt = '', encoding = Encoding.default_external) @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