From 1f756fc2404d5411a085672e17e9c85f205efd34 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 23 Oct 2013 12:17:00 -0700 Subject: [PATCH] tell Terminal.app what directory I'm in --- zsh/zshrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zsh/zshrc b/zsh/zshrc index 8fc5c73..75e7f5b 100755 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -63,6 +63,18 @@ else export VISUAL="vi" fi +# Set Apple Terminal.app resume directory +if [[ $TERM_PROGRAM == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]] { + function chpwd { + local SEARCH=' ' + local REPLACE='%20' + local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" + printf '\e]7;%s\a' "$PWD_URL" + } + + chpwd +} + # 2. Limits # =========