3

enter image description here

I've been reading about this topis here and tried the solution given to change the terminal name (refer to the picture on item number 1)

But none of them can change the terminal's name (item number 1).

user@linux:~$ gnome-terminal --title="SOME TITLE HERE"
user@linux:~$ 

user@linux:~$ PROMPT_COMMAND='echo -ne "\033]0;SOME TITLE HERE\007"'
user@linux:~$ 

user@linux:~$ echo -ne "\033]0;SOME TITLE HERE\007"
user@linux:~$ 

I know that item number 2 can be changed with PS1. But the title (item number 1) still didn't change even after I change the PS1

user@linux:~$ is fine. I don't want to change this, I just want to rename the terminal's title on the top (item number 1)

  • I switched to another terminal because of no good way to set the terminal title. Using PS1 hacks it sometimes changes and sometimes doesn't. And usually PS1 shows where I am and the title should show the use of the terminal (what I want to do there). tl;dr bad decision to remove this functionality for quite some people. Look for alternatives if you rely on that feature like me. – Enno Gröper Jun 23 '19 at 6:48
2

The feature gnome-terminal --title have been removed since Gnome v3
If you want to keep Gnome Terminal and change the Window title you will have to play with PS1, see below how to do it.


The Gnome 2 terminal has been forked as mate-terminal bundled in Ubuntu Mate. The title option is still available with this version
sudo apt-get install mate-terminal
enter image description here


With Gnome Terminal, a way to set the window title will be to play with PS1
You can add a function to your .bashrc file an call it to change the Window/Tab title

nano ~/.bashrc
Add the function

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

source ~/.bashrc to reload
set-title Some new title to change the Window/Tab title

enter image description here

Limitation: when a program changes the PS1, the title may change too (example: ssh to another host will reset the custom title)

| improve this answer | |
  • Limitation: when a program changes the PS1, the title may change too (example: ssh to another host will reset the custom title) – cmak.fr Jun 24 '19 at 4:36

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.