1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

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))
This commit is contained in:
Kyrylo Silin 2013-01-27 01:31:06 +02:00
parent b3d525b15a
commit 584aea188f

View file

@ -24,12 +24,8 @@ class Pry::Pager
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)