diff options
author | aycabta <aycabta@gmail.com> | 2020-01-05 22:46:35 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-01-05 22:48:39 +0900 |
commit | da028a4fbf879144a09192c5cc4a0020c69048e0 (patch) | |
tree | 232fbef082a90749e35e68165c82855c0d68ff55 /lib | |
parent | 54fd50c951d7bee259bcbc491bf223fb992d12c9 (diff) | |
download | ruby-da028a4fbf879144a09192c5cc4a0020c69048e0.tar.gz |
Rescue EOFError
If C-d is pressed before IRB is ready, IRB crashes because EOFError occurs.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/ansi.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb index 27157f0db9..cd780c6189 100644 --- a/lib/reline/ansi.rb +++ b/lib/reline/ansi.rb @@ -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 |