Last active
February 1, 2017 09:48
-
-
Save eggman64/db6e1ad3aaa0828cc87504055ccb8e60 to your computer and use it in GitHub Desktop.
Open new terminal in previous cwd
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
# Add to .bashrc | |
# Sauce: http://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/ | |
# Commands to be executed before the prompt is displayed | |
# Save current working dir | |
PROMPT_COMMAND='pwd > "${XDG_RUNTIME_DIR}/.cwd"' | |
# Change to saved working dir | |
[[ -f "${XDG_RUNTIME_DIR}/.cwd" ]] && cd "$(< ${XDG_RUNTIME_DIR}/.cwd)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment