about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2014-04-29 16:16:45 +0200
committerhut <hut@lepus.uberspace.de>2014-04-29 16:16:45 +0200
commit8bf5af78620e9c4ee1959aeb81b01273d1ca5aba (patch)
tree3af29d9a5037a6c86929645997489288434d91fb /ranger
parent1f3a71cbf7e4604ce931f89dfd571968f53b6bba (diff)
parent04681ff7ceb8a7db4111dbfac5f06477561c4c4a (diff)
downloadranger-8bf5af78620e9c4ee1959aeb81b01273d1ca5aba.tar.gz
Merge remote-tracking branch 'perdu/CDPATH'
Diffstat (limited to 'ranger')
-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)