mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/irb] Rescue Errno::EINVAL on IRB pp
http://rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20210119T070008Z.log.html.gz is caused by: /export/home/chkbuild/chkbuild-gcc/tmp/build/20210119T150010Z/ruby/lib/reline/ansi.rb:157:in `winsize': Invalid argument - <STDIN> (Errno::EINVAL) from /export/home/chkbuild/chkbuild-gcc/tmp/build/20210119T150010Z/ruby/lib/reline/ansi.rb:157:in `get_screen_size' from /export/home/chkbuild/chkbuild-gcc/tmp/build/20210119T150010Z/ruby/lib/reline.rb:168:in `get_screen_size' from /export/home/chkbuild/chkbuild-gcc/tmp/build/20210119T150010Z/ruby/lib/forwardable.rb:238:in `get_screen_size' from /export/home/chkbuild/chkbuild-gcc/tmp/build/20210119T150010Z/ruby/lib/irb/color_printer.rb:7:in `pp' from -e:1:in `<main>' https://github.com/ruby/irb/commit/1719514598
This commit is contained in:
parent
eeacdcb9a0
commit
1f87725cae
1 changed files with 15 additions and 5 deletions
|
@ -4,11 +4,21 @@ require 'irb/color'
|
||||||
|
|
||||||
module IRB
|
module IRB
|
||||||
class ColorPrinter < ::PP
|
class ColorPrinter < ::PP
|
||||||
def self.pp(obj, out = $>, width = Reline.get_screen_size.last)
|
class << self
|
||||||
q = ColorPrinter.new(out, width)
|
def pp(obj, out = $>, width = screen_width)
|
||||||
q.guard_inspect_key {q.pp obj}
|
q = ColorPrinter.new(out, width)
|
||||||
q.flush
|
q.guard_inspect_key {q.pp obj}
|
||||||
out << "\n"
|
q.flush
|
||||||
|
out << "\n"
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def screen_width
|
||||||
|
Reline.get_screen_size.last
|
||||||
|
rescue Errno::EINVAL # in `winsize': Invalid argument - <STDIN>
|
||||||
|
79
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def text(str, width = nil)
|
def text(str, width = nil)
|
||||||
|
|
Loading…
Add table
Reference in a new issue