[TriLUG] gnome-terminal window title

Alan Porter porter at trilug.org
Wed Apr 6 09:28:41 EDT 2005


> The window title changes to username at pwd as I navigate around.
> It changes correctly if I login to other linux systems. However,
> If I login to hpux systems it does not.
> 
> What file contains this information?

If you're running bash, this is set by the PS1 environment variable.
Mine is set to PS1=\u@\h:\w\$ \[\e]0;\u@\h:\w\a\]
All of that gobbledygoop in the second half is caught by your
xterm/konsole/whatever and used for the window title.  This should
be set in /etc/profile with something like this:

if [ "$PS1" ]; then

   # only print this if it's an interactive shell
   echo "/etc/profile"

   if [ "$BASH" ]; then
     PS1='\u@\h:\w\$ '
   else
     if [ "`id -u`" -eq 0 ]; then
       PS1='# '
     else
       PS1='$ '
     fi
   fi

    # put user at host:/path in the xterm/konsole title bar
    if [ "$TERM" == "xterm" ] ; then
      export PS1=$PS1"\[\e]0;\u@\h:\w\a\]"
    fi

fi



Alan





More information about the TriLUG mailing list