mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
c91fb5db59
commit
b5c4570af4
2 changed files with 3 additions and 2 deletions
|
@ -142,7 +142,7 @@ class Reline::ANSI
|
|||
unless @@buf.empty?
|
||||
return @@buf.shift
|
||||
end
|
||||
until c = @@input.raw(intr: true) { select([@@input], [], [], 0.1) && @@input.getbyte }
|
||||
until c = @@input.raw(intr: true) { @@input.wait_readable(0.1) && @@input.getbyte }
|
||||
Reline.core.line_editor.resize
|
||||
end
|
||||
(c == 0x16 && @@input.raw(min: 0, tim: 0, &:getbyte)) || c
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'timeout'
|
||||
require 'io/wait'
|
||||
|
||||
class Reline::GeneralIO
|
||||
def self.reset(encoding: nil)
|
||||
|
@ -36,7 +37,7 @@ class Reline::GeneralIO
|
|||
end
|
||||
c = nil
|
||||
loop do
|
||||
result = select([@@input], [], [], 0.1)
|
||||
result = @@input.wait_readable(0.1)
|
||||
next if result.nil?
|
||||
c = @@input.read(1)
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue