Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.