Skip to content

Commit

Permalink
fix issue with 'SIGINT' handling in LineEditor#reset
Browse files Browse the repository at this point in the history
@old_trap is the string "DEFAULT" and not a callable object (Proc)
if there are no other signal handlers for SIGINT signal to chain.
  • Loading branch information
luke-gru committed Jun 8, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b738261 commit 9d95ae8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/reline/line_editor.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9d95ae8

Please sign in to comment.