Add title command to zshrc
This commit is contained in:
parent
e544a5ef3f
commit
379e4d8137
|
@ -90,8 +90,17 @@ local base_prompt="${base_prompt}%{$blue%}]%# %{%f%}"
|
||||||
# Set terminal titles automatically
|
# Set terminal titles automatically
|
||||||
###
|
###
|
||||||
|
|
||||||
|
# allow resetting the terminal title like in DOS
|
||||||
|
function title {
|
||||||
|
export PROMPT_DOS_TITLE="$1"
|
||||||
|
}
|
||||||
|
|
||||||
precmd() {
|
precmd() {
|
||||||
|
if [ "$PROMPT_DOS_TITLE" != "" ]; then
|
||||||
|
print -Pn "\e]0;${PROMPT_DOS_TITLE}\a"
|
||||||
|
else
|
||||||
print -Pn "\e]0;%n@${PROMPT_HOSTNAME}:%~\a"
|
print -Pn "\e]0;%n@${PROMPT_HOSTNAME}:%~\a"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
Loading…
Reference in New Issue
Block a user