diff options
Diffstat (limited to 'ranger.py')
-rwxr-xr-x | ranger.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ranger.py b/ranger.py index 6915457f..d11b49d9 100755 --- a/ranger.py +++ b/ranger.py @@ -24,9 +24,20 @@ # source /path/ranger /path/ranger """": if [ $1 ]; then + trap "kill -2 %+" INT + RANGER="$1" shift - cd "`$RANGER --cd-after-exit \"$@\" 3>&1 1>&2 2>&3 3>&-`" + + exec 3< <($RANGER --cd-after-exit $@ 3>&1 1>&2 2>&3 3>&-) + read NEWDIR <&3 + exec 3<&- + + cd $NEWDIR + + trap - INT + unset RANGER + unset NEWDIR else echo "usage: source path/to/ranger.py path/to/ranger.py" fi |