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

ruby-changes:57899

From: Nobuyoshi <ko1@a...>
Date: Thu, 26 Sep 2019 00:27:40 +0900 (JST)
Subject: [ruby-changes:57899] ae83dbe28d (master): Get rid of `IO.select` to fix multiline paste

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

From ae83dbe28d35f43ec60d913fbae5d3a95ae2af05 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 24 Sep 2019 09:03:38 +0900
Subject: Get rid of `IO.select` to fix multiline paste


diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb
index 37ddfa1..8832dca 100644
--- a/lib/reline/ansi.rb
+++ b/lib/reline/ansi.rb
@@ -24,14 +24,7 @@ class Reline::ANSI https://github.com/ruby/ruby/blob/trunk/lib/reline/ansi.rb#L24
     unless @@buf.empty?
       return @@buf.shift
     end
-    c = nil
-    loop do
-      result = select([@@input], [], [], 0.001)
-      next if result.nil?
-      c = @@input.read(1)
-      break
-    end
-    c&.ord
+    @@input.getbyte
   end
 
   def self.ungetc(c)
-- 
cgit v0.10.2


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

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