From 00295a61998df665d13b1495852f31fb037084ae Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Fri, 29 Jul 2011 11:51:52 +0200 Subject: [PATCH] support for Lion Terminal working directory handling --- zshrc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/zshrc b/zshrc index a25c577..15d4da5 100644 --- a/zshrc +++ b/zshrc @@ -4,6 +4,24 @@ autoload -Uz promptinit promptinit prompt walters +# Set up working dir change event +chpwd() { + [[ -o interactive ]] || return + # Bubble information up to the terminal + case $TERM_PROGRAM in + Apple_Terminal) + local SEARCH=' ' + local REPLACE='%20' + local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" + printf '\e]7;%s\a' "$PWD_URL" + ;; + *) + # NOOP + ;; + esac +} +chpwd # call in right now + # Use emacs keybindings even if our EDITOR is set to vi bindkey -e