среда, 11 сентября 2013 г.

ZSH: restoring last working directory

This little snippet helps to save/restore working directory on start/exit zsh shell:
autoload -Uz add-zsh-hook
function save_pwd {
echo "$PWD" > "$HOME/.zshpwd"
}
add-zsh-hook chpwd save_pwd
cd `cat $HOME/.zshpwd 2>/dev/null`
put it in ~/.zshrc :)

Комментариев нет:

Отправить комментарий

Thanks for your posting!