Gnome Terminal – How to Rename Terminal Tab Title in Gnome-Terminal

gnome-terminal

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

Best Answer

Create a function in ~/.bashrc:

function set-title() {
  if [[ -z "$ORIG" ]]; then
    ORIG=$PS1
  fi
  TITLE="\[\e]2;$*\a\]"
  PS1=${ORIG}${TITLE}
}

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

Related Question