Re: Naming windows in X

From: Jim Meier <fatjim_at_no.spam.please>
Date: Mon Dec 11 2000 - 14:33:38 CST

On Mon, 11 Dec 2000, Scott Wunsch wrote:
> echo '^[];New Title^G'
>

I thought I'd share a little snipped of my .bash_profile,as it seems
relevant. It titles all xterms (and other terminals which advertise
themselves as xterms) with the shell's working directory.

If anyone has a good way to intercept the launching of a program and
change the window title to the command line that started it, I'd be very
interested! :)

if [ $TERM = xterm ]; then
    echo "^[]0;`pwd`^G"
    cd() {
        if [ -z "$1" ]; then
            builtin cd ~
        elif true ; then
            builtin cd $1
        fi
        echo "^[]0;`pwd`^G"
    }
fi

^[ -> escape character, ^G = ctrl-G, just like before

-Jim

--
Saskatoon Linux Group Mailing List.
"Ein zuviel an Ordnung ruft in uns unweigerlich den Wunsch auf Totschlag
hervor."
--
To unsubscribe, send mail to
'linux-request@slg.org' with
'unsubscribe' in the body.
Received on Mon Dec 11 14:33:38 2000

This archive was generated by hypermail 2.1.8 : Sun Jan 09 2005 - 13:54:00 CST