If you are like me administrating lots of unix servers where you have to do
different tasks at different servers simultaneously then you can easily lose track of which
screen window is doing what on your laptop. My solution for this in the zsh
shell is using the following in my .zshrc:
preexec()
{
if echo ${TERMCAP} | grep screen > /dev/null
then
screen -X title ${1}
fi
}
precmd()
{
if echo ${TERMCAP} | grep screen > /dev/null
then
screen -X title $(echo $PWD | sed "s#$HOME#~#")
fi
}
This sets the title of a window where a command is running to the name of the
command being run. When no command is running it sets it to the current
working directory. The advantage is that I no longer have to set the titles manually.
The disadvantage is that the titles can get very long. Therefor I have in my .screenrc
the following line:
bind l windowlist
Which allows me to quickly get the window list with ^Al.