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:
parent
b3d525b15a
commit
584aea188f
1 changed files with 2 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue