зеркало из https://github.com/github/ruby.git
[ruby/reline] Handle Errno::ENOTTY correctly
https://github.com/ruby/reline/commit/8daa392ba6
This commit is contained in:
Родитель
242bad9a87
Коммит
1b543dc226
|
@ -91,6 +91,8 @@ class Reline::ANSI
|
|||
rescue Errno::EIO
|
||||
# Maybe the I/O has been closed.
|
||||
nil
|
||||
rescue Errno::ENOTTY
|
||||
nil
|
||||
end
|
||||
|
||||
@@in_bracketed_paste_mode = false
|
||||
|
|
|
@ -775,6 +775,17 @@ begin
|
|||
EOC
|
||||
end
|
||||
|
||||
def test_with_newline
|
||||
omit if Reline::IOGate.win?
|
||||
cmd = %Q{ruby -e 'print(%Q{abc def \\e\\r})' | ruby -I#{@pwd}/lib -rreline -e 'p Reline.readline(%{> })'}
|
||||
start_terminal(50, 50, ['bash', '-c', cmd])
|
||||
close
|
||||
assert_screen(<<~'EOC')
|
||||
> abc def
|
||||
"abc def "
|
||||
EOC
|
||||
end
|
||||
|
||||
private def write_inputrc(content)
|
||||
File.open(@inputrc_file, 'w') do |f|
|
||||
f.write content
|
||||
|
|
Загрузка…
Ссылка в новой задаче