about summary refs log tree commit diff stats
path: root/wrapper.sh
blob: 080033c21a6a22499d12869e045b9d1d353846b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
#
# Use this file to activate a special feature:
# Changing the directory of the parent shell after exiting Ranger.
# To use this, create an alias for this command in your shell config:
#
# source path/to/wrapper.sh path/to/ranger.py
#
# (This does not work with all shells, it was successfully tested
# with bash and zsh though.)
#
if [ $1 ]; then
	cd "`$1 --cd-after-exit $@ 3>&1 1>&2 2>&3 3>&-`"
else
	echo "use with: source path/to/wrapper.sh path/to/ranger.py"
fi