1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Degenerate the terminal size to [$LINES, $COLUMNS] if it is unknown

This is a workaround for https://github.com/ruby/irb/issues/50

https://github.com/ruby/reline/commit/5725677d1a
This commit is contained in:
Yusuke Endoh 2019-12-29 09:01:00 +09:00 committed by aycabta
parent e082f41611
commit 337ba56aff

View file

@ -50,7 +50,11 @@ class Reline::ANSI
end
def self.get_screen_size
@@input.winsize
s = @@input.winsize
return s if s[0] > 0 && s[1] > 0
s = [ENV["LINES"].to_i, ENV["COLUMNS"].to_i]
return s if s[0] > 0 && s[1] > 0
[24, 80]
rescue Errno::ENOTTY
[24, 80]
end