Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can I programmically set the gnome-terminal title?

I've tried gnome-terminal --title="bla"

But this opens a new terminal window while outputting

$ gnome-terminal --title=bla
Xlib:  extension "RANDR" missing on display ":0.0".
share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Got this to work

PROMPT_COMMAND='echo -ne "\033]0;g0\007"' 

If this did not change your terminal title you will first have to open ~/.bashrc. Find the line that says:

PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"

Comment out this line, by putting a # character in front of it:

# PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"

Now add this line (you may want to put it just after the commented-out line):

PROMPT_COMMAND='echo -ne "\033]0;Terminal title name change here\007"'

Replace Terminal title name change here with whatever you want to change the Terminal title to be, if anything.

share|improve this answer
add comment

gksu gedit /usr/share/applications/gnome-terminal.desktop

find Name=Terminal

change to Name=whatever you want

save restart

name changed

IS that what you wanted ?

Or another way without leaving the terminal

cd /usr/share/applications

sudo sed -i 's/Terminal/Your new name here/' gnome-terminal.desktop

to see the name change appear on the icon in launcher you must also restart unity

unity &> /dev/null & disown

for more info about unity restart read http://askubuntu.com/a/38597/71679

`

share|improve this answer
    
Wanted a way to do it without restarting the terminal window. –  Kurru Jun 26 '12 at 0:17
    
ok is that what you wanted ? –  damien Jun 27 '12 at 4:16
    
Got this to work PROMPT_COMMAND='echo -ne "\033]0;g0\007"' –  Kurru Jun 27 '12 at 4:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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