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:
parent
54fd50c951
commit
da028a4fbf
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue