Permalink
Browse files

Pager: use TerminalInfo API for `::page_size`

Fix issue #829 (NoMethodError: undefined method `winsize'
for #<IO:<STDOUT>>, The Same Error as #549 But On The Latest Version
(0.9.11.4))
  • Loading branch information...
1 parent 2baf98d commit 81956a3f4644c6f77e30e8d396bdfd53e1a05f80 @kyrylo kyrylo committed Jan 26, 2013
Showing with 2 additions and 6 deletions.
  1. +2 −6 lib/pry/pager.rb
View
@@ -24,12 +24,8 @@ def self.page(text, pager = nil)
end
def self.page_size
- @page_size ||= begin
- require 'io/console'
- $stdout.winsize.first
- rescue LoadError
- 27
- end
+ rows = Pry::TerminalInfo.screen_size
+ @page_size ||= (rows && rows.first || 27)
end
def initialize(text)

0 comments on commit 81956a3

Please sign in to comment.