Skip to content

Commit

Permalink
The stdlib readline should raise Interrupt when pressing C-c
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 13, 2019
1 parent 70fe473 commit 98f919e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/reline/line_editor.rb
Expand Up @@ -65,9 +65,8 @@ def reset(prompt = '', encoding = Encoding.default_external)
@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"
raise Interrupt
}
Reline::IOGate.set_winch_handler do
@rest_height = (Reline::IOGate.get_screen_size.first - 1) - Reline::IOGate.cursor_pos.y
Expand Down

0 comments on commit 98f919e

Please sign in to comment.