jeroen.se
by jnieuwen
some tricks I use when using zsh and screen
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.
0 comments

Nick:
Email:
Make your own addition with integers (needed to make sure you aint a spambot):
+ =
Categories
Cycling (2)
Gadgets (3)
Misc (22)
Scripting (23)
Travel (7)
Unix (24)
Archive
April 2010 (2)
January 2010 (1)
December 2009 (1)
November 2009 (2)
May 2009 (1)
April 2009 (1)
March 2009 (1)
February 2009 (7)
January 2009 (3)
December 2008 (1)
November 2008 (4)
October 2008 (5)
September 2008 (1)
August 2008 (3)
July 2008 (2)
June 2008 (2)
May 2008 (3)
April 2008 (1)
March 2008 (1)
February 2008 (1)
January 2008 (4)
December 2007 (1)
November 2007 (7)
October 2007 (4)
September 2007 (1)
August 2007 (2)
June 2007 (6)
May 2007 (8)