Thus spake Peter Ruskin on Fri, Jan 09, 2004 at 08:45:01AM CST
> On Friday 09 Jan 2004 14:13, Andrew Gaffney wrote:
> > I routinely have atleast 3 xterm's at any one time. I need a way to
> > easily distinguish between them. Is there a command I can run from
> > the xterm to change its title to something I specify?
> 
> There's a bash-prompt HOWTO that describes how to do this. I customised 
> it and put the file "proml" in my home directory, made it executable 
> and sourced it in .bashrc or /etc/profile (can't remember exactly).

You might also want to look at
<http://ldp.kernelnotes.de/HOWTO/Xterm-Title.html>

This describes the escape sequences available to change the title of an
xterm.  I include this in my bash prompt string, so I have access in the
xterm title to any information which can be accessed using the special bash
prompt escapes, e.g. \h for hostname, \u for user, etc, although these are
generally available as env vars as well.

Basically:

    * ESC]0;stringBEL -- Set icon name and window title to string
    * ESC]1;stringBEL -- Set icon name to string
    * ESC]2;stringBEL -- Set window title to string

BEL is octal \007

My PS1 looks like this:

\[\e]0;\]$machine  `if [ "$ACCEPT_KEYWORDS" = "~x86" ]; then echo
"(unstable)"; fi;` $USE .....
($USER)\[\007\e[1m\e[${pcolor}m\]\h:\[\e[31m\]\w\[\e[m\]\$

$machine and $pcolor are defined elsewhere in my .bash_profile.  $machine is
the name of the current machine and $pcolor is the color of the command
prompt defined by the UID (cyan for UID=0 and yellow for everything else)

-- 
Lindsay Haisley       | "Everything works    |     PGP public key
FMP Computer Services |       if you let it" |      available at
512-259-1190          |    (The Roadie)      | <http://www.fmp.com/pubkeys>
http://www.fmp.com    |                      |

--
[EMAIL PROTECTED] mailing list

Reply via email to