Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
What's your PS1 variable? – Aluísio A. S. G. Mar 12 '13 at 18:57
Here it is: [16:08]~>echo $PS1 [\e]2;\h\a][\A]\W>[\e[0m] – mr odus Mar 12 '13 at 20:08

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.

share|improve this answer
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. :) – Ƭᴇcʜιᴇ007 Mar 12 '13 at 23:43
Same problem, the title will flash "MyWindowTitle" and then go right back to the hostname. – mr odus Mar 13 '13 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.

share|improve this answer
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 '15 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .