Previously I changed my gnome-terminal title to display which server I was logged into. I don't remember how I did this and I can't change it now.

I ran through my .bashrc and found nothing that would set it, and logged in as su. As superuser the title also changes.

I checked my .Xdefaults file... nothing

I tried to open a gnome terminal with:

gnome-terminal --title=$PWD 

Any title I set with the above command or PROMPT_COMMAND will be shown for half a second and then revert to my server name.

I looked through the terminal settings too. Any thoughts where I could have made this change? Running on CentOS.

  • What's your PS1 variable? Mar 12, 2013 at 18:57
  • Here it is: [16:08]~>echo $PS1 [\e]2;\h\a][\A]\W>[\e[0m]
    – mr odus
    Mar 12, 2013 at 20:08

2 Answers 2


You can do so by:

wmctrl -r :ACTIVE: -N "MyWindowTitle"

to note - you need the wmctrl package first.


You can find more possible solutions at the given source.

  • Stop apologizing for short answers -- this is plenty adequate IMO. :) But, if you really don't feel you have the time to post a decent answer, please just don't post one. :) Mar 12, 2013 at 23:43
  • Same problem, the title will flash "MyWindowTitle" and then go right back to the hostname.
    – mr odus
    Mar 13, 2013 at 15:00

It's probably using shell escape codes like this:
echo -ne "\033]2;hello\007"
This will set the terminal title to be hello. And from the description I'd guess that you are doing something like this:
gnome-terminal -> shell(e.g. bash) -> ssh user@othermachine -> bash In that case, you need to search for it on the local machine, might be something bash or ssh is doing.

  • Yes, this would probably be better off as a comment on the question, but since I'm not allowed to comment on other thing than my own, this had to be an answer.
    – hfox
    Apr 17, 2015 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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