Thanks a lot for the hints.

I use bash (and linux).

An HOWTO about dynamic title can be found at:
      http://sunsite.unc.edu/LDP/HOWTO/mini/Xterm-Title.html

A short summary:

I added the following lines to my ~/.bashrc:

if [ "$TERM" = "rxvt" ] || [ "$TERM" = "xterm" ]; then
  echo -ne "\E]2;Terminal $$ `date "+%H:%M:%S"`\a"
fi

This sets the terminal's title ONCE to: "Terminal PID TIME".
Thats seems enough to distinguish between several terminals.
Although I don't know if it proves useful, yet.

Another example given in the how-to is utilizing the PS1 env-var.

  export PS1="\[\033]0;\u@\h: \w\007\]bash\$ "

This changes the title every time the working directory changes.
Maybe useful, too.


Chris, your example has a major downside:
Using env PROMPT_COMMAND the title is set AFTER the entered command
has been finished. So, if you run mc and afterwards xeyes the terminal's
title remains "... mc ..." while xeyes is running. 
But thanks for the hint, anyway.


P.S.: I added "set wrapmargin=72" to vimrc

--
Gerrit Hoetzel



On Thu, Jul 11, 2002 at 08:58:33AM -0400, Chris Grossmann wrote:
> Do you use BASH?
> 
> Try something like this in your .bashrc:
> export PROMPT_COMMAND='echo -n
> "^[]2;`hostname`:`pwd`:`history 1`^G"'
> 
> Note that the "^]" and "^G" need to be control characters.
> 
> With bash + rxvt ( + linux? ), you should get something like
> this for the title of the rxvt:
> 
> chris-lap:/home/chris:  6  echo "blackbox rules"
> 
> I'll leave it as an exercise to the reader to remove the "6"
> and to add in the pid of the rxvt.  :) 
>  
> 
> Gerrit Hoetzel wrote:
>  > bbkeys' menu-cycling feature comes handy when choosing among a huge list
>  > of windows.
>  > But as I tend to run several rxvt's with the same title (i.e. "rxvt"),
>  > choosing the right one is a mere guess. What would be nice to solve this
>  > is to look upon the window's child processes and display the last one
>  > found or the last common process found if child-processes fork again.
>  > (Use "ps auxfw" or "pstree" to get an idea.)
>  > Or at least an optional feature to display the pid, too.
>  > 
>  > Thanks
>  > 
> 
> -- 
> Chris Grossmann
> web: http://www.grossmann.us

Reply via email to