I use both the zsh and bash shell, and most of the time I run them in screen. This happens in my favourite terminal: urxvt (aka rxvt-unicode).
I have a pretty consistence terminal title in both shells. I use hostname[last part of current path]:
I have the following in my ~/.zsh:
if [[ ${TERM} == "screen-bce" || ${TERM} == "screen" ]]; then
precmd () { print -Pn "\033k\033\134\033k%m[%1d]\033\134" }
preexec () { print -Pn "\033k\033\134\033k%m[$1]\033\134" }
else
precmd () { print -Pn "\e]0;%n@%m: %~\a" }
preexec () { print -Pn "\e]0;%n@%m: $1\a" }
fi
PS1=$'%{\e[0;32m%}%m%{\e[0m%}:%~> '
export PS1
My ~/.bashrc:
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
PS1='\[\033[0;32m\]\h\[\033[00m\]:\w> '
export PS1 PROMPT_COMMAND
And finally my ~/.screenrc
hardstatus string "%h"
caption always "%{= kw} %-w%{= wk}%n*%t%{-}%+w%{= kw} %=%d %M %0c %{g}%H%{-}"