1
0

Add title command to zshrc

This commit is contained in:
Noah 2016-03-11 11:33:00 -08:00
parent e544a5ef3f
commit 379e4d8137

View File

@ -90,8 +90,17 @@ local base_prompt="${base_prompt}%{$blue%}]%# %{%f%}"
# Set terminal titles automatically
###
# allow resetting the terminal title like in DOS
function title {
export PROMPT_DOS_TITLE="$1"
}
precmd() {
if [ "$PROMPT_DOS_TITLE" != "" ]; then
print -Pn "\e]0;${PROMPT_DOS_TITLE}\a"
else
print -Pn "\e]0;%n@${PROMPT_HOSTNAME}:%~\a"
fi
}
###############################################################################