diff options
author | aycabta <aycabta@gmail.com> | 2019-09-23 17:31:41 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-09-23 17:33:25 +0900 |
commit | b443bdbdb997a6b5c0d6f06cada146f523361980 (patch) | |
tree | 85016ad58320607d58ec6037f7ee72038b18b253 /lib/reline | |
parent | 934507472c92ccada3f30be183fea5066427efda (diff) | |
download | ruby-b443bdbdb997a6b5c0d6f06cada146f523361980.tar.gz |
Use short wait for select(2)
It is one of the reasons why paste to IRB is slow.
Diffstat (limited to 'lib/reline')
-rw-r--r-- | lib/reline/ansi.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb index b12dc2f6d3..37ddfa1053 100644 --- a/lib/reline/ansi.rb +++ b/lib/reline/ansi.rb @@ -26,7 +26,7 @@ class Reline::ANSI end c = nil loop do - result = select([@@input], [], [], 0.1) + result = select([@@input], [], [], 0.001) next if result.nil? c = @@input.read(1) break @@ -39,7 +39,7 @@ class Reline::ANSI end def self.retrieve_keybuffer - result = select([@@input], [], [], 0.1) + result = select([@@input], [], [], 0.001) return if result.nil? str = @@input.read_nonblock(1024) str.bytes.each do |c| |