about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index ec853f1b..8424b51d 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -451,7 +451,19 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
     def enter_dir(self, path, remember=False, history=True):
         """Enter the directory at the given path"""
         cwd = self.thisdir
+        # bash and ksh syntax
+        cdpath = os.environ.get('CDPATH', None)
+        if cdpath == "":
+            # zsh and csh syntax
+            os.environ.get('cdpath', None)
+        paths = cdpath.split(':')
         result = self.thistab.enter_dir(path, history=history)
+        if result == 0:
+            for p in paths:
+                curpath = p + '/' + path
+                if os.path.isdir(curpath):
+                    result = self.thistab.enter_dir(curpath, history=history)
+                    break
         if cwd != self.thisdir:
             if remember:
                 self.bookmarks.remember(cwd)