Add title command to zshrc
This commit is contained in:
parent
e544a5ef3f
commit
379e4d8137
11
home/.zshrc
11
home/.zshrc
|
@ -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() {
|
||||
print -Pn "\e]0;%n@${PROMPT_HOSTNAME}:%~\a"
|
||||
if [ "$PROMPT_DOS_TITLE" != "" ]; then
|
||||
print -Pn "\e]0;${PROMPT_DOS_TITLE}\a"
|
||||
else
|
||||
print -Pn "\e]0;%n@${PROMPT_HOSTNAME}:%~\a"
|
||||
fi
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
|
Loading…
Reference in New Issue
Block a user