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
|
@ -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 New Issue