summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/__init__.py1
-rw-r--r--ranger/core/actions.py9
2 files changed, 7 insertions, 3 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index 118809c7..74bbd41b 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -22,6 +22,7 @@ RANGERDIR = os.path.dirname(__file__)
 TICKS_BEFORE_COLLECTING_GARBAGE = 100
 TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200
 MACRO_DELIMITER = '%'
+DEFAULT_PAGER = 'less'
 LOGFILE = '/tmp/ranger_errorlog'
 USAGE = '%prog [options] [path/filename]'
 STABLE = True
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index bb38f11d..76a9088a 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -909,7 +909,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 			write("\n")
 
 		temporary_file.flush()
-		self.run(app='pager', files=[File(temporary_file.name)])
+		pager = os.environ.get('PAGER', ranger.DEFAULT_PAGER)
+		self.run([pager, temporary_file.name])
 
 	def dump_commands(self):
 		temporary_file = tempfile.NamedTemporaryFile()
@@ -931,7 +932,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 				write("    :%s\n" % cmd.get_name())
 
 		temporary_file.flush()
-		self.run(app='pager', files=[File(temporary_file.name)])
+		pager = os.environ.get('PAGER', ranger.DEFAULT_PAGER)
+		self.run([pager, temporary_file.name])
 
 	def dump_settings(self):
 		from ranger.container.settingobject import ALLOWED_SETTINGS
@@ -943,7 +945,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 			write("%30s = %s\n" % (setting, getattr(self.settings, setting)))
 
 		temporary_file.flush()
-		self.run(app='pager', files=[File(temporary_file.name)])
+		pager = os.environ.get('PAGER', ranger.DEFAULT_PAGER)
+		self.run([pager, temporary_file.name])
 
 	# --------------------------
 	# -- File System Operations