Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reset the terminal title when on the prompt

  • Loading branch information...
commit feab095c7011dfa391c6e0ef866a6387b6c6f9f2 1 parent ea45044
@amarshall authored
Showing with 8 additions and 1 deletion.
  1. +3 −0  zsh/functions/precmd
  2. +5 −1 zsh/functions/promptinit
View
3  zsh/functions/precmd
@@ -8,3 +8,6 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [ -z "$INSIDE_EMACS" ]; then
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
fi
+
+# Set the terminal title
+promptinit "true"
View
6 zsh/functions/promptinit
@@ -16,4 +16,8 @@ local uhc='%{%F{magenta}%}' # user-host color
[[ $HOME != $(pwd) ]] && p='%6~' # Don't display the path if we're home
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
Please sign in to comment.
Something went wrong with that request. Please try again.