diff options
Diffstat (limited to 'lib/reline/ansi.rb')
-rw-r--r-- | lib/reline/ansi.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb index 8d83da854c..27157f0db9 100644 --- a/lib/reline/ansi.rb +++ b/lib/reline/ansi.rb @@ -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 |