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

Re: Off Topic - putty, RH, debian, title changes upon login



William Jensen <jensenb@bodach.com> writes:

> Hi guys,
> 
> I found this little bit of trivia interesting but I cannot figure out how it
> is happening.  Under a friends RH box when I ssh into it from PuTTY it will
> change the titlebar to username@his.domain.com: /directory.  That's very cool,
> however, when I ssh into my debian box it just puts up domain.com - PuTTY.  Does
> anyone know why/how this is happening for the RH box or how I could enable
> this type of behavior for the Debian box?  It's rather handy to have a "short"
> PS1 and have the full path that your in reflected in the titlebar.  
> 
> Regards,
> 
> Bill

Here's some prompt and window title stuff to play with for
e.g. /etc/profile. Adjust the settings the way you want.


# Distinguish user- and root prompt
if [ `id -un` != root ]; then
   PS1="\u@\h:\w\\$ " # user's prompt is normal
else
   PS1="\[\033[31m\]\u\[\033[m\]@\h:\w\\$ " # root's prompt is red
fi
export PS1

# Xterm-emulator's window title
# posted on this list some time ago by somebody else
if ! [ -z $DISPLAY ]; then
   export PROMPT_COMMAND='echo -ne "\033]2;${USER}@${HOSTNAME}:${PWD}\007"'
fi


Have fun
-- Andre



Reply to: