Skip to content

Commit

Permalink
Degenerate the terminal size to [$LINES, $COLUMNS] if it is unknown
Browse files Browse the repository at this point in the history
This is a workaround for ruby/irb#50
  • Loading branch information
mame committed Dec 29, 2019
1 parent d98ac8f commit 5725677
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/reline/ansi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def self.retrieve_keybuffer
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
Expand Down

0 comments on commit 5725677

Please sign in to comment.