[前][次][番号順一覧][スレッド一覧]

ruby-changes:57738

From: aycabta <ko1@a...>
Date: Sat, 14 Sep 2019 00:17:37 +0900 (JST)
Subject: [ruby-changes:57738] 98f919ed47 (master): The stdlib readline should raise Interrupt when pressing C-c

https://git.ruby-lang.org/ruby.git/commit/?id=98f919ed47

From 98f919ed47a136c9a51c7ab5fa39ffb4965a1687 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Sat, 14 Sep 2019 00:16:08 +0900
Subject: The stdlib readline should raise Interrupt when pressing C-c


diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 2e964cb..75281c6 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -65,9 +65,8 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L65
     @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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]