diff options
Diffstat (limited to 'ranger.py')
-rwxr-xr-x | ranger.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ranger.py b/ranger.py index 2ab5ee1d..a7a1a864 100755 --- a/ranger.py +++ b/ranger.py @@ -1,6 +1,18 @@ #!/usr/bin/python # coding=utf-8 +# An embedded shell script. Assuming this file is /usr/bin/ranger, +# this hack allows you to use the cd-after-exit feature by typing: +# source ranger ranger +"""": +if [ $1 ]; then + cd "`$1 --cd-after-exit $@ 3>&1 1>&2 2>&3 3>&-`" +else + echo "use with: source path/to/ranger.py path/to/ranger.py" +fi +return 1 +""" + import sys, os # Change the directory of the parent shell after exiting Ranger. |