Gnome: Change title of current terminal from bash command line
Andrew Mclaughlin
I know there are options to start a new terminal with a specified title, and that is is possible to change the title from a terminal using the menu: 'Terminal' -> Set Title.
However, I want to change it for a current terminal from command line. How can I change the title for an existing Gnome terminal from command line?
4 Answers
Output a suitable xterm escape sequence.
echo -ne '\033]0;New title\007'See also How to change the title of an xterm.
11If you need to set it to the hostname where you are logged into you can use:
echo -ne "\033]0;${HOSTNAME}\007" It might be worth your while to try KDE. It has tabbed terminal windows, and each tab can be named just by right clicking on the tab.
1If you're using Ubuntu 16.04 you may need to clear the PS1 and PROMPT_COMMAND like:
PS1=$
PROMPT_COMMAND=
echo -en "\033]0;New title\a"I put together a write up on it at link.