Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my local machine, window titles within screen update nicely to the pwd. I have

shelltitle '% |bash'

in my .screenrc. Yet when I ssh to another host, the window title remains as the pwd from where I ran the ssh command, rather than updating to be the pwd within my ssh session.

How can I make my screen window title relative to my ssh session?

share|improve this question

You can change the window title of the current screen session with echo -en "\033kNEW TITLE\033\134". On your local machine you have probably some code in your ~/.bashrc oder in some global config file (the location can depend on OS flavor) which changes the title accordingly, e.g. in your prompt setting; try echo $PS1.

So, you have to modify the remote ~/.bashrc, too. A good starting point can be

PS1='\033k\u@\h: \w\033\134\u@\h:\w > '

which will display a prompt like user@machine:~ > and sets the screen title to user@machine:~.

Please be aware, that this will not change the title of your terminal window. The command for that is echo -ne "\033]0;SOMETHING\007".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.