Add pager detection by using `which` command

Fix issue #743 (pager gives warnings `Missing filename ("less --help"
for help)`)

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
This commit is contained in:
Kyrylo Silin 2012-11-19 23:37:03 +02:00
parent a6c4c6950d
commit 07137ee5e5
1 changed files with 3 additions and 1 deletions

View File

@ -51,7 +51,9 @@ class Pry::Pager
end
def self.available?
`#{default_pager}`rescue nil
pager_executable = default_pager.split(' ').first
`which #{ pager_executable }`
rescue
end
def initialize(*)