[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic Title

From: Brian Kroth
Subject: Re: Dynamic Title
Date: Wed, 17 Jun 2009 15:52:58 -0500
User-agent: Mutt/1.5.16 (2007-06-09)

>    I have followed the advice Brian gave here, and I can set this up easily
>    on my own system. Yet, when I start a terminal session, ssh to another
>    host from where I start screen, this solution with preexec doesn't work.
>    I have copied my (working) .bashrc, .screenrc and preeexec.bash over to
>    the remote system, so the files are identical, but as to why this wont
>    work is eluding me. How can the fact that i come from a remote host, with
>    the same setting, be in the way of sending the dynamic title? Can any one
>    shed some light on this?
>    Leen
>    I have the following in my bashrc:
>    . ./preeexec.bash
>    set_xterm_title () {
>        local title="$1"
>        case "$TERM" in
>        xterm*|rxvt*)
>            echo -ne "\e]0;$title\007"
>            ;;
>        screen)
>            echo -ne "\033k$title\033\\"
>            ;;
>        esac
>    }
>    precmd () {
>        set_xterm_title "address@hidden `dirs -0` $PROMPTCHAR"
>    }
>    preexec () {
>        set_xterm_title "address@hidden"
>    }
>    preexec_install
>    And in my screenrc:
>            setenv SCREEN_RUN_HOST $SCREEN_HOST
>            setenv SCREEN_RUN_USER $USER
>            setenv LC_SCREEN_RUN_HOST $SCREEN_HOST
>            setenv LC_SCREEN_RUN_USER $USER

Sorry for the delayed response.  I'm guessing that SCREEN_HOST isn't

To hopefully simplify things I've attached a set of stripped down files
from my own setup including a basic .bashrc, .bash.preexec, .screenrc,
and .ssh/config all complete with comments and links.  Hopefully the
formatting doesn't get all screwed up.  If it does I can attach a
tarball, but I think that's generally against mailing list etiquette.

The .bash.preexec is fairly different from the one that was originally
posted.  It includes functions to rename a running screen session, turn
on/off dynamic window naming and force a particular name, history files
with timestamps, and some different formatting.  

I'd suggest you dump them into a test user's environment for playing
with and then take the bits that you like and put them in your own.

Also, these things should probably be on the remote host as well.  Most
of the hosts I logon to are managed by cfengine and for the rest I have
a simple rsync script to put a copy there.  Something like svn would
probably also work.


Attachment: .bashrc
Description: Text document

Attachment: .bash.preexec
Description: Text document

Attachment: .screenrc
Description: Text document

Attachment: config
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]