Used to be able to right click on the tab and change the title. Not sure how to do this anymore. Just upgraded to Fedora 21.

EDIT: I have switched from gnome-terminal to ROXterm


Create a function in ~/.bashrc:

function set-title() {
  if [[ -z "$ORIG" ]]; then

Then use your new command to set the terminal title. It works with spaces in the name too

set-title my new tab title

It is possible to subsequently use set-title again (original PS1 is preserved as ORIG).


The user title code was removed1 from gnome-terminal 3.14. To set the title, you could use an escape sequence:

printf "\e]2;YOUR TITLE GOES HERE\a"

or e.g. with bash:


1: see gnome bug 724110 and gnome bug 740188.

  • 11
    Thanks for a link to the discussions. I guess the answer to this was NO. A funny quote from one of the links: "modern users do not use terminals". LOL. – penner Jan 5 '15 at 19:12
  • This doesn't work for me: Fedora 21, Bash 3.14.3. – kdbanman May 8 '15 at 15:31
  • It works on fc22 also.. – Balaji Perumal Jan 8 '16 at 5:47
  • 4
    Apparently, it's coming back... "Yeah sorry, the --title option is restored in GNOME 3.20 (March 2016 release), which we released half a year ago, but Ubuntu 16.04 shipped with GNOME 3.18 (September 2015 release), which had removed this option." Michael Catanzaro's 2016-09-01 18:41:45 UTC comment #31 (from second bug, 740188) – sage Jan 12 '17 at 22:10
  • 2
    @sage - there is no feature, Michael's comment there is about the --title option which I can confirm that was indeed restored. However, the Q here is about the right-click option to rename the currently open tab - a different issue... – don_crissti Jan 13 '17 at 16:54

New versions of gnome-terminal just thrown away most helpful professional features. :-(

I have tried to setup and get an older version of gnome-terminal running and also compared alternatives.

If terminator is too exotic for you, the mate-terminal is a great option! It is a fork of gnome-terminal and just keeps all the good features:

  • you can open multiple tabs from the command line giving them different titles

    mate-terminal --tab -t "aaa" --tab -t "bbb" --tab -t "ccc"
  • you can set up a keyboard shortcut (I use Ctrl+Shift-i) to set a title

  • Guake is also not a bad variant – Bunyk Jan 12 '18 at 10:00

put this in .bashrc:

function title() { 
  p1='echo -ne "\033]0;' 
  • And run this with 'title your new title' – B T Nov 13 '19 at 20:02

When you run a resident program like top or ssh, the tab is properly labeled.

gnome-terminal --tab -e top -t "aaa" --tab -e top -t "bbb" 

If you're using Ubuntu 16.04 you may need to:

echo -en "\033]0;New title\a"

I list this an more info about it at link.


@Weston Ganger wrote this function (and posted it here) to put into ~/.bashrc:

function set-title() {
  if [[ -z "$ORIG" ]]; then

You can then set a terminal title by calling set-title TERMINAL NAME (quotes around the name are optional).

It looked pretty mysterious to me (see my comments under his answer), so I spent a few hours last night reading and studying to figure out what the heck he had done and why it worked. Here's what I found:

  1. As of gnome-terminal 3.16.2 or so (see comments under this answer), "the option --title is no longer supported." Otherwise, you'd just do gnome-terminal --title="my title", like I used to do here.
  2. Per this answer here, and many comments all around this answer, you should be using $@ instead of $* to represent all input arguments in the script above. Apparently $@ is less bug-prone and more compatible, as it's the POSIX way to represent "all input arguments". Therefore, in my version below I use $@ instead of $*.
  3. It turns out that in nearly any terminal (so long as the given terminal supports it), there are ANSI escape codes, which are a form of "in-band signaling", which can be used to set a terminal title. See the section titled "Customizing the terminal window title" in this most-excellent archlinux wiki here. The Bash escape sequence to set the terminal title looks like this: \[\e]2;new title\a\], and to apply this title to your terminal window, all you have to do is modify its "Prompt String 1", or PS1 variable, by adding this "set title" escape sequence after your current Prompt String 1, like this: PS1="${PS1}\[\e]2;new title\a\]". Since gnome-terminal no longer supports the --title argument, this appears to be the only way to set the title anymore.

Now, here is my version of Weston Ganger's function, with extensive explanatory comments. This will be going into my dotfiles so I never lose it:

# Set the title string at the top of your current terminal window or terminal window tab
set-title() {
    # If the length of string stored in variable `PS1_BAK` is zero...
    # - See `man test` to know that `-z` means "the length of STRING is zero"
    if [[ -z "$PS1_BAK" ]]; then
        # Back up your current Bash Prompt String 1 (`PS1`) into a global backup variable `PS1_BAK`

    # Set the title escape sequence string with this format: `\[\e]2;new title\a\]`
    # - See: https://wiki.archlinux.org/index.php/Bash/Prompt_customization#Customizing_the_terminal_window_title
    # Now append the escaped title string to the end of your original `PS1` string (`PS1_BAK`), and set your
    # new `PS1` string to this new value

Usage examples:

  • Static title strings (title remains fixed):
    • set-title my tab 1 OR set-title "my tab 1"
    • set-title $PWD OR set-title "$PWD"
  • Dynamic title strings (title updates each time you enter any terminal command): you may use function calls or variables within your title string and have them dynamically updated each time you enter a new command. Simply enter a command or access a global variable inside your title string. Be sure to use single quotes around the title string for this to work!:
    • set-title '$PWD' - this updates the title to the Present Working Directory every time you cd to a new directory!
    • set-title '$(date "+%m/%d/%Y - %k:%M:%S")' - this updates the title to the new date and time every time it changes and you enter a new terminal command! The format looks like this: 02/06/2020 - 23:32:58


  1. https://askubuntu.com/questions/315408/open-terminal-with-multiple-tabs-and-execute-application/1026563#1026563
  2. My dotfiles (config files, scripts, & generic user settings): https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles

Main References:

  1. How to rename terminal tab title in gnome-terminal?
  2. https://wiki.archlinux.org/index.php/Bash/Prompt_customization#Customizing_the_terminal_window_title
  3. https://www.thegeekstuff.com/2008/09/bash-shell-take-control-of-ps1-ps2-ps3-ps4-and-prompt_command/
  4. Why is bash's prompt variable called PS1?
  5. Bash Reference Manual: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html

As an expansion onto @Weston Ganger's answer, if you want to automatically set a title upon opening a new Gnome terminal, then add this to the bottom of your ~/.bashrc:

if [ ! -z "$SET_TITLE" ]; then
    set-title $SET_TITLE;
    export SET_TITLE=;

Then launch a terminal like:

gnome-terminal --tab -e 'bash -c "export SET_TITLE=\"my title\"; bash -i"'

and it will automatically run set-title to apply the title.


one line solution, add following line in your .bashrc

alias tab_name='read -p "Name to Assign:" tabname ;  printf "\e]2;$tabname\a" '

now type tab_name in terminal i.e.

user:~$ tab_name  
Name to Assign: ( type desired name here! )


Your Answer

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

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