[Fix #215] Set Terminal title on Mac OS X 10.8

This commit is contained in:
Sorin Ionescu 2012-07-08 17:26:33 -04:00
parent bede1a2a71
commit 060f34c7e5
1 changed files with 6 additions and 6 deletions

View File

@ -82,13 +82,13 @@ function set-title-precmd {
if [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]]; then
# Set the current working directory in Apple Terminal.
printf '\e]7;%s\a' "file://$HOST${PWD// /%20}"
else
set-window-title "${(%):-%~}"
for kind in tab screen; do
# Left-truncate the current working directory to 15 characters.
set-${kind}-title "${(%):-%15<...<%~%<<}"
done
fi
set-window-title "${(%):-%~}"
for kind in tab screen; do
# Left-truncate the current working directory to 15 characters.
set-${kind}-title "${(%):-%15<...<%~%<<}"
done
fi
}
add-zsh-hook precmd set-title-precmd