For quite some time I have now been using screen with a constantly visible window list. Up to now I had to manually set these window titles. Now I finally invested some time to get it working automatically with my favourite shell.
#.zshrc:
precmd () {
if [[ "$TERM" = "screen" ]]; then
local SHORTPWD=”`basename $PWD`”
echo -ne “\ek${SHORTPWD}/\e\\”
fi
}
preexec () {
if [[ "$TERM" = "screen" ]]; then
local CMD=”${1}”
if [[ ${#CMD} -ge 15 ]]; then
CMD=”${${(z)CMD}[1]} …”
fi
echo -ne “\ek${CMD}\e\\”
fi
}
#.screenrc
hardstatus alwayslastline
hardstatus string “%{= .W}%-Lw%{= C}%50>[%n* %t]%{-}%+Lw%= (%c)%< "