Why is the window title not updated on closing ssh connection

Asked by fidel on 2016-06-17

I am usually working with several terminator windows (actually running 0.98-1 on Ubuntu 16.04) and doing a lot of remote connections to other hosts.

I am wondering when a terminator-window title is set and when it will be updated at all.

You might wonder why i am asking this - its simple - just follow my small example:

- If i open up a terminator window and ssh as user A to HOST_1 the window title is set to A@HOST_1.
This is fine so far.

- If i now close this ssh connection and return to my local host in the same window - the window title is still A@HOST_1 which is misleading. When switching back from HOST_1 to localhost the window title should be updated as well i think.

- The window title seems to get updated only if i now ssh as user A to another host - lets call it HOST_2. If i do so the window title gets updated to A@HOST_2. Which again is good.

Question information

English Edit question
Terminator Edit question
No assignee Edit question
Last query:
Last reply:

For me this works as expected. For info I'm using Terminator 0.98 (+ changes to trunk) and standard bash on Ubuntu.

The way I understand this works is that the bash process echo's an escape code to update the title. The VTE widget receives that escape code and updates the terminals title, and emits a signal for title-changed which is what Terminator acts upon for updating widgets and the like. It gets the title from VTE.

I think what is happening is that your local shell client is not echoing the right escape code to set the title when you logout from the remote ssh shell. I can replicate your symptom if I mess around with my PS1 environment variable. For reference from my Ubuntu .bashrc:

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"

Somewhere in there is the escape sequence that sets the title to the value of the prompt. Hope that helps.

Can you help with this problem?

Provide an answer of your own, or ask fidel for more information if necessary.

To post a message you must log in.