Created
May 22, 2018 12:52
-
-
Save guipacheco2/aef21ea6dc061ef60ce7f5bb62a81785 to your computer and use it in GitHub Desktop.
put you in your last-used directory when opening a new window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# emulate bash PROMPT_COMMAND (only for zsh) | |
precmd() { eval "$PROMPT_COMMAND" } | |
# open new terminal in same dir | |
PROMPT_COMMAND='pwd > "${HOME}/.cwd"' | |
[[ -f "${HOME}/.cwd" ]] && cd "$(< ${HOME}/.cwd)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment