diff --git a/zsh/zshrc.local b/zsh/zshrc.local index 2cc79f1..ac17292 100644 --- a/zsh/zshrc.local +++ b/zsh/zshrc.local @@ -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%}%(!.#.$) '