Skip to content

Commit

Permalink
[ruby/reline] Degenerate the terminal size to [$LINES, $COLUMNS] if i…
Browse files Browse the repository at this point in the history
…t is unknown

This is a workaround for ruby/irb#50

ruby/reline@5725677d1a
  • Loading branch information
mame authored and aycabta committed Dec 31, 2019
1 parent e082f41 commit 337ba56
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 337ba56

Please sign in to comment.