Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Gnome: Change title of current terminal from bash command line

Writer 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.

11

If 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.

1

If 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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy