zsh: Set window title in *rxvt* and xterm
This commit is contained in:
parent
ede7efcb57
commit
84a48d00be
|
@ -73,6 +73,24 @@ if [[ "$TERM" != "dumb" ]]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# set terminal title
|
||||
case $TERM in
|
||||
(*xterm* | *rxvt*)
|
||||
|
||||
# Write some info to terminal title.
|
||||
# This is seen when the shell prompts for input.
|
||||
function precmd {
|
||||
print -Pn "\e]0;zsh%L @%m %(1j,%j job%(2j|s|); ,)%~\a"
|
||||
}
|
||||
# Write command and args to terminal title.
|
||||
# This is seen while the shell waits for a command to complete.
|
||||
function preexec {
|
||||
printf "\033]0;%s @%s\a" "$1" "$HOST"
|
||||
}
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
# Set prompt
|
||||
#PS1=$'%(!.%{\e[01;32m%}.%{\e[01;31m%})%(?..%? )%(!.%{\e[01;31m%}.%{\e[01;32m%})%n@%m%{\e[01;34m%} %~ %{\e[00m%}%(!.#.$) '
|
||||
|
||||
|
|
Loading…
Reference in a new issue