Skip to content

Commit

Permalink
Pager: use TerminalInfo API for ::page_size
Browse files Browse the repository at this point in the history
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
kyrylo committed Jan 26, 2013
1 parent 2baf98d commit 81956a3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/pry/pager.rb
Expand Up @@ -24,12 +24,8 @@ def self.page(text, pager = nil)
end end


def self.page_size def self.page_size
@page_size ||= begin rows = Pry::TerminalInfo.screen_size
require 'io/console' @page_size ||= (rows && rows.first || 27)
$stdout.winsize.first
rescue LoadError
27
end
end end


def initialize(text) def initialize(text)
Expand Down

0 comments on commit 81956a3

Please sign in to comment.