mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Don't try to run the system pager if 'less' is not available.
Closes #712.
This commit is contained in:
parent
6a67ea418a
commit
c8dc5d44a7
1 changed files with 3 additions and 2 deletions
|
@ -19,9 +19,10 @@ class Pry::Pager
|
||||||
def self.page(text, pager = nil)
|
def self.page(text, pager = nil)
|
||||||
case pager
|
case pager
|
||||||
when nil
|
when nil
|
||||||
|
`less` rescue nil
|
||||||
|
no_pager = $?.exitstatus != 0
|
||||||
is_jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
|
is_jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
|
||||||
is_windows = Pry::Helpers::BaseHelpers.windows?
|
(is_jruby || no_pager) ? SimplePager.new(text).page : SystemPager.new(text).page
|
||||||
(is_jruby || is_windows) ? SimplePager.new(text).page : SystemPager.new(text).page
|
|
||||||
when :simple
|
when :simple
|
||||||
SimplePager.new(text).page
|
SimplePager.new(text).page
|
||||||
when :system
|
when :system
|
||||||
|
|
Loading…
Reference in a new issue