зеркало из https://github.com/github/ruby.git
[ruby/reline] Check Errno::EIO
Catch Errno::EIO what will be occurred if the console terminates I/O before Reline finishes rendering. https://github.com/ruby/reline/commit/e51eaa6d43
This commit is contained in:
Родитель
f0d3d4fedb
Коммит
215fe54777
|
@ -243,6 +243,8 @@ module Reline
|
|||
break if line_editor.finished?
|
||||
end
|
||||
Reline::IOGate.move_cursor_column(0)
|
||||
rescue Errno::EIO
|
||||
# Maybe the I/O has been closed.
|
||||
rescue StandardError => e
|
||||
line_editor.finalize
|
||||
Reline::IOGate.deprep(otio)
|
||||
|
|
|
@ -67,6 +67,9 @@ class Reline::ANSI
|
|||
end
|
||||
c = @@input.raw(intr: true, &:getbyte)
|
||||
(c == 0x16 && @@input.raw(min: 0, tim: 0, &:getbyte)) || c
|
||||
rescue Errno::EIO
|
||||
# Maybe the I/O has been closed.
|
||||
nil
|
||||
end
|
||||
|
||||
def self.ungetc(c)
|
||||
|
|
Загрузка…
Ссылка в новой задаче