How can I change my gnome-terminal title?

2

2

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.

mr odus

Posted 2013-03-12T17:46:14.097

Reputation: 63

What's your PS1 variable? – Aluísio A. S. G. – 2013-03-12T18:57:42.757

Here it is:

[16:08]~>echo $PS1
\[\e]2;\h\a\][\A]\W>\[\e[0m\]
 – mr odus  – 2013-03-12T20:08:46.913

Answers

2

You can do so by:

wmctrl -r :ACTIVE: -N "MyWindowTitle"

to note - you need the wmctrl package first.

source

You can find more possible solutions at the given source.

Lorenzo Von Matterhorn

Posted 2013-03-12T17:46:14.097

Reputation: 2 137

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 – 2013-03-12T23:43:06.233

Same problem, the title will flash "MyWindowTitle" and then go right back to the hostname. – mr odus – 2013-03-13T15:00:10.460

0

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.

hfox

Posted 2013-03-12T17:46:14.097

Reputation: 1

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 – 2015-04-17T13:43:42.023