fix issue with 'SIGINT' handling in LineEditor#reset#34
Conversation
@old_trap is the string "DEFAULT" and not a callable object (Proc) if there are no other signal handlers for SIGINT signal to chain.
|
in 9d95ae8 ; the code- def reset(prompt = '', encoding = Encoding.default_external)
@rest_height = (Reline::IOGate.get_screen_size.first - 1) - Reline::IOGate.cursor_pos.y
@screen_size = Reline::IOGate.get_screen_size
reset_variables(prompt, encoding)
@old_trap = Signal.trap('SIGINT') {
scroll_down(@highest_in_all - @first_line_started_from)
Reline::IOGate.move_cursor_column(0)
@old_trap.call if @old_trap.respond_to?(:call) # can also be string, ex: "DEFAULT"
}
endexplaining the code
and all this is inside the braces in |
|
@snow8gaia Sorry, I don't understand your comment. |
|
I don't fully understand how this pull request fixes this? Its great that it does. For eg:-
So, you ran
@old_trap is the string
so the Thanks anyways. |
|
ignore the timing of my earlier comment pull/34#issuecomment-503693550. Just read your response to issue/34#issuecomment-50368544; can't reply now. |
@old_trap is the string "DEFAULT" and not a callable object (Proc)
if there are no other signal handlers for SIGINT signal to chain.
Found running 'make test-all' running Ruby's test suite and CTRL-C'ing the terminal, resulted in NoMethodError 'call' on string "DEFAULT".