GNOME Bugzilla – Bug 775036
gnome-terminal does not change window and tab title after exiting root account
Last modified: 2016-11-25 18:09:23 UTC
If a user change user to root via sudo su command then exit root account by writing exit, gnome-terminal does not change window title or tab name to default one or profile's preferred title. Steps to produce bug: 1- Open gnome-terminal -> title of the terminal shows user's preferred title like Terminal or user_name@host_name:some_dir_path 2- sudo su -> title or tab name of the terminal changes to root@host_name:some_dir_path 3- Exit root account by exit command 4- Title of the terminal remains root@host_name:some_dir_path What I expect to happen: 1- Open gnome-terminal -> title of the terminal shows user's preferred title like Terminal or user_name@host_name:some_dir_path 2- sudo su -> title of the terminal changes to root@host_name:some_dir_path 3- Exit root account by exit command 4- Title of the terminal should change to user's preferred title like Terminal or user_name@host_name:some_dir_path In order to determine whether the bug is triggered by Ubuntu modules, I tested gnome-terminal with LIBOVERLAY_SCROLLBAR=0 UBUNTU_MENUPROXY=0 NO_UNITY_GTK_MODULE=1 environment variables and bug still remains. Here is the link to the Launchpad bug: https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1388478 LC_ALL=C gnome-terminal --version GNOME Terminal 3.20.2 LC_ALL=C lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.10 Release: 16.10 Codename: yakkety
Could you please try the same steps with "xterm" rather than "gnome-terminal"? From the terminal emulator's point of view, there's no such concept of "user's preferred title", and there's no way to revert to a "default" title. It can only "set" a new title. The terminal emulator obeys the instructions it receives from the shell or any other app running inside. If such an instruction tells it to change the title, it does so. Moreover, it has no way of knowing whether the title change request comes from the user's shell or from the root account. So there are two possibilities: Either at one point gnome-terminal stops acting on such title change requests (I think it's extremely unlikely); or your shell does something wrong, in which case it's not a gnome-terminal bug. (By the way, I've tested on Ubuntu 16.10 with a brand new account and it works just fine, as you'd expect it. So it's probably something broken with your personal settings.)
@Egmont Koblinger, first of all thank you for helping me and such an informative answer. I tried same steps with xterm and the behavior is same as gnome-terminal. After reading your answer, I created a new user, logged in as new user and tried the same steps. The result was what I would expected, which means this particular behavior was caused by something that I changed. In order to find what could be the reason for this behavior, I commented out every variable in ~/.bashrc and ~/.profile one by one but it did not work. Anyway, I will try to find the culprit.
Compare them with those of the brand new user (or /etc/skel).