On Sat, May 06, 2000 at 12:19:25AM -0400,
Patrick Dahiroc <[EMAIL PROTECTED]> wrote:

> 1) I'm running gnome-terminal as my xterm. The title on the
> window simply says 'Terminal'. Is possible to have the window
> title dynamically change to the current working directory. Kinda
> like the way emacs changes the window title to the name of the
> current file.

I have this in ~/.zshrc. Not sure how to do it in bash (why would
you use bash, anyway?).

settitle() {
    case $TERM in
    *xterm* | *rxvt* | (dt|k|E)term)
        print -Pn "\e]2;$*\a"
        ;;
    esac
}

seticontitle() {
    case $TERM in
    *xterm* | *rxvt* | (dt|k|E)term)
        print -Pn "\e]1;$*\a"
        ;;
    esac
}

precmd() {
        [[ -t 1 ]] || return    # return if not on a terminal

        settitle "[EMAIL PROTECTED]: %~"
        seticontitle "[EMAIL PROTECTED]: %~"
}

P.S. Please wrap lines at 65 columns.

-- 
Eric Gillespie, Jr. <*> [EMAIL PROTECTED]

"Let us be thankful we have commerce. Buy more. Buy more now.
 Buy. And be happy."
--OMM (THX 1138)

Attachment: pgpzHedsIofTW.pgp
Description: PGP signature

Reply via email to