1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Rescue EOFError

If C-d is pressed before IRB is ready, IRB crashes because EOFError occurs.
This commit is contained in:
aycabta 2020-01-05 22:46:35 +09:00
parent 54fd50c951
commit da028a4fbf

View file

@ -41,12 +41,15 @@ class Reline::ANSI
end
def self.retrieve_keybuffer
begin
result = select([@@input], [], [], 0.001)
return if result.nil?
str = @@input.read_nonblock(1024)
str.bytes.each do |c|
@@buf.push(c)
end
rescue EOFError
end
end
def self.get_screen_size