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:
parent
e082f41611
commit
337ba56aff
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue