Click to See Complete Forum and Search --> : silly ssh + xterm question


Lazlo
08-11-2003, 02:08 PM
I have noticed that when I ssh into another box through an xterm, the top menu bar changes to reflect the user name / host name you are currently connected to. That is it changes from user1@box1 to user1@box2. This is very nice for when you have something running on the console and can't see the command prompt (when I forget which machine I've ssh'd into). The only problem is that while my redhat machines display the hostnames nicely my slackware ones don't. They still have the current host I'm running the xterm in displayed. Does anyone know what controls this and how I might be able to fix it?

Hayl
08-11-2003, 02:12 PM
put this in ~/.bashrc

# Change the window title of X terminals
case $TERM in
xterm*|rxvt|eterm)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
;;
screen)
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
;;
esac

Lazlo
08-11-2003, 02:20 PM
Slackware has no .bashrc, but .profile worked just fine! Thanks man!