by lucaspiller · 13y ago · 0 comments
# record directory in ~/.lastpwd
record_pwd() {
pwd > ~/.lastpwd
}
chpwd_functions=(record_pwd)
# go to last directory when opening a new shell
if [[ -d `cat ~/.lastpwd` ]]; then
cd `cat ~/.lastpwd`
fi
For other shells that don't have something like chpwd_functions you could just alias cd.As of tmux 1.7, this should be unnecessary. Every tab and split will open in the working directory of the current pane, and the behavior can be changed with the `default-path` option.