summary refs log tree commit diff stats
path: root/ranger.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger.py')
-rwxr-xr-xranger.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/ranger.py b/ranger.py
index 9703b243..636bd384 100755
--- a/ranger.py
+++ b/ranger.py
@@ -20,16 +20,10 @@
 # ----------------------------------------------------------------------------
 #
 # An embedded shell script. It allows you to change the directory
-# of the parent shell to the last visited directory in ranger after exit.
-# For more information, check out doc/cd-after-exit.txt
-# To enable this, start ranger with:
-#     source /path/ranger /path/ranger
+# after you exit ranger by starting it with: source ranger ranger
 """":
 if [ $1 ]; then
-	ranger_exec="$1"
-	shift
-	cd "`exec $ranger_exec --cd-after-exit $@ 3>&1 1>&2 2>&3 3>&-`"
-	unset ranger_exec
+	$@ && cd "$(grep \^\' ~/.ranger/bookmarks | cut -b3-)"
 else
 	echo "usage: source path/to/ranger.py path/to/ranger.py"
 fi
@@ -45,7 +39,7 @@ __doc__ = """Ranger - file browser for the unix terminal"""
 # is neither in the same directory as this file, nor in one of
 # pythons global import paths.
 try:
-	from ranger import main
+	from ranger.__main__ import main
 
 except ImportError:
 	import sys