Gnome Terminal does not change tab title when SSHing into other machines


If you have multiple tabs open and in each different open SSH connection, it would be awesome to see the remote hosts hostname in the tab title of gnome-terminal.
I found a lot of approaches to rename tabs in general and also by editing ~/.bashrc. But nothing worked for me. Additionally, most of those blogs I found were very old. So not sure if it should be possible today.

Maybe it’s worth starting this discussion again with the focus on Ubuntu 20 and newer.

Is there a solution for that?

Thanks a lot!

This typically works by default, so you need to isolate the issue.
Try connecting to a modern system like Fedora 34 running in a VM with default settings.
If the issue persists, the cause must be on the client side, otherwise it’s a server side problem.

@vgaetera I’ve tried it with two fresh Ubuntu 20 installations. I can approve that it is working in this setup!

Now I’ve created a new profile on my Ubuntu 20 client and tried to connect to our remote SSH hosts. It does not work in this case. I assume that this is a hint, that the problem is on the server-side, right?
So I think my question is now: What can I check?

1 Like
echo -e -n "\033];${USER}@${HOSTNAME}\007"
export PS1="\[\e]0;\u@\h:\w\a\]\u@\h:\w\$ "
1 Like

I found out that we have a modified PS1 variable.
But if we export it does not work. Maybe because of the time or the color definition?

PS1="\[\e[0;37m\][\A]\[\e[0;31m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]# "

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.