Skip to content

Instantly share code, notes, and snippets.

@eggman64
Last active February 1, 2017 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eggman64/db6e1ad3aaa0828cc87504055ccb8e60 to your computer and use it in GitHub Desktop.
Save eggman64/db6e1ad3aaa0828cc87504055ccb8e60 to your computer and use it in GitHub Desktop.
Open new terminal in previous cwd
# 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