> Rasmus Peter Tamstorf wrote:
> This is what I use to change the xterm title to include my current host
> and directory.  The iconname has also been changed to reflect the host.
> BTW, this is all for bash.  You set your prompt to this string and then
> each time your prompt changes, the title/iconname is updated:
> 
> 	PS1="\[\033]0;\h:\w\007\033]1;\h\007\]\h\$ "
> 
> The \033 implies an ESC character. The \007 implies a ^G.
This wouldn't be so bad, except it redraws the entire line everytime you type
a character.  Not too bad on localhost, but very slow over a modem ...
Anyone ever figure out how to keep the redraw from occurring?
My solution was to do this:
PS1='\h\w:\$ '
if [ "$TERM" = "xterm" ]; then
  function cd ()
  {
    builtin cd $*
    xtitle "${HOSTNAME%%.*}:$PWD `cat /etc/ip` (`date`)"
  }
  else
  function cd ()
  {
    builtin cd $*
  }
fi
xtitle=()
{
    echo -e -n "\033]2;$*\007"
}
(also for bash)
-- 
Todd Fries
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Thu May 16 1996 - 14:27:06 BST