support for Lion Terminal working directory handling

This commit is contained in:
Loic Nageleisen 2011-07-29 11:51:52 +02:00
parent 989a311081
commit 00295a6199

18
zshrc
View file

@ -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