summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/config/commands.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index ba7d51d3..32f5da8c 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -107,7 +107,8 @@ class cd(Command):
             self.shift()
             destination = os.path.realpath(self.rest(1))
             if os.path.isfile(destination):
-                destination = os.path.dirname(destination)
+                self.fm.select_file(destination)
+                return
         else:
             destination = self.rest(1)