Skip to content

Commit

Permalink
Use short wait for select(2)
Browse files Browse the repository at this point in the history
It is one of the reasons why paste to IRB is slow.
  • Loading branch information
aycabta committed Sep 23, 2019
1 parent 9345074 commit b443bdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/reline/ansi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.getc
end
c = nil
loop do
result = select([@@input], [], [], 0.1)
result = select([@@input], [], [], 0.001)
next if result.nil?
c = @@input.read(1)
break
Expand All @@ -39,7 +39,7 @@ def self.ungetc(c)
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|
Expand Down

0 comments on commit b443bdb

Please sign in to comment.