about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-03-08 12:48:33 +0100
committertoonn <toonn@toonn.io>2021-03-08 12:48:33 +0100
commitb50949e29ec931a8fc534b464158e55135076fa8 (patch)
treecb74840d36a41a24d11cc1c73a25874177c01b9b /ranger
parentcd17ea8c1d2cd89754f625df25134f00c7227b65 (diff)
parent12b3af22d5a22619053f91bd34d4df3fbebea136 (diff)
downloadranger-b50949e29ec931a8fc534b464158e55135076fa8.tar.gz
Merge branch 'ideal-master'
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index adfbe94d..16bc8133 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -28,6 +28,7 @@ from ranger.core.loader import CommandLoader, CopyLoader
 from ranger.core.shared import FileManagerAware, SettingsAware
 from ranger.core.tab import Tab
 from ranger.ext.direction import Direction
+from ranger.ext.get_executables import get_executables
 from ranger.ext.keybinding_parser import key_to_string, construct_keybinding
 from ranger.ext.macrodict import MacroDict, MACRO_FAIL, macro_val
 from ranger.ext.next_available_filename import next_available_filename
@@ -968,14 +969,18 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
         pager.set_source(lines)
 
     def display_help(self):
-        manualpath = self.relpath('../doc/ranger.1')
-        if os.path.exists(manualpath):
-            process = self.run(['man', manualpath])
-            if process.poll() != 16:
-                return
-        process = self.run(['man', 'ranger'])
-        if process.poll() == 16:
-            self.notify("Could not find manpage.", bad=True)
+        if 'man' in get_executables():
+            manualpath = self.relpath('../doc/ranger.1')
+            if os.path.exists(manualpath):
+                process = self.run(['man', manualpath])
+                if process.poll() != 16:
+                    return
+            process = self.run(['man', 'ranger'])
+            if process.poll() == 16:
+                self.notify("Could not find manpage.", bad=True)
+        else:
+            self.notify("Failed to show man page, check if man is installed",
+                        bad=True)
 
     def display_log(self):
         logs = list(self.get_log())