aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/utils.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index f8965d090..79f739826 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -123,7 +123,8 @@ def puts_columns items, cols = 4
items.concat("\n") unless items.empty?
# determine the best width to display for different console sizes
- console_width = `/bin/stty size`.chomp.split(" ").last
+ console_width = `/bin/stty size`.chomp.split(" ").last.to_i
+ console_width = 80 if console_width <= 0
longest = items.sort_by { |item| item.length }.last
optimal_col_width = (console_width.to_f / (longest.length + 2).to_f).floor
cols = optimal_col_width > 1 ? optimal_col_width : 1