Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Reset the terminal title when on the prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
amarshall committed Apr 22, 2012
1 parent ea45044 commit feab095
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions zsh/functions/precmd
Expand Up @@ -8,3 +8,6 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [ -z "$INSIDE_EMACS" ]; then
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL" printf '\e]7;%s\a' "$PWD_URL"
fi fi

# Set the terminal title
promptinit "true"
6 changes: 5 additions & 1 deletion zsh/functions/promptinit
Expand Up @@ -16,4 +16,8 @@ local uhc='%{%F{magenta}%}' # user-host color
[[ $HOME != $(pwd) ]] && p='%6~' # Don't display the path if we're home [[ $HOME != $(pwd) ]] && p='%6~' # Don't display the path if we're home
g=$(git_info_for_prompt) # Display information about current git repo g=$(git_info_for_prompt) # Display information about current git repo


printf "%s" $uhc$u$h $eac$c $cdc$p $gic$g $pcc'%#'$eac' ' if [ -z "$1" ]; then
printf "%s" $uhc$u$h $eac$c $cdc$p $gic$g $pcc'%#'$eac' '
else
print -Pn "\e]0;" $u$h$c "%~\a"
fi

0 comments on commit feab095

Please sign in to comment.