Skip to content

Commit

Permalink
[Fix ohmyzsh#215] Set Terminal title on Mac OS X 10.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sorin-ionescu authored and indrajitr committed Aug 5, 2012
1 parent f13e14e commit 07f141f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/terminal/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 07f141f

Please sign in to comment.