summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-04-02 21:52:46 +0200
committerhut <hut@lavabit.com>2012-04-02 21:52:46 +0200
commit0d60aaaa981c32f86270dd5a0049e9ef8a94ec66 (patch)
treee796f4ce82dc4a7c7eb34595a936af8c5c020d63 /ranger
parent53f8129c4177194a096f4895586fe77915580daf (diff)
downloadranger-0d60aaaa981c32f86270dd5a0049e9ef8a94ec66.tar.gz
core.actions: fixed dump_{commands,keybindings,settings}
Diffstat (limited to 'ranger')
-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