None of the currently posted answers works/answers the question.
As per my original question, neither setting PS1 nor PROMPT_COMMAND had any effect.
Using only a command at the command prompt, how do I change the title of the current terminal tab?
Many posts suggest this:
echo -en "\033]0;New terminal title\a"
but it does nothing.
None of the current answers works (some don't answer the question), so for clarity:
- Once the title is changed, I don't want it to change if I change directory etc
- I don't want the same title on all tabs. I only want to set the title for the tab I run the command in
- I want multiple tabs to each have different titles
Also, the PROMPT_COMMAND variable is not set in my terminal sessions. If I set it:
PROMPT_COMMAND='echo -en "\033]0;New terminal title\a"'
it has no effect.
What is the correct command?
FYI, the output of uname -a is:
Linux d136172 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux



$PS1contain? – muru Jun 22 '15 at 00:15/usr/bin/gnome-terminal(from standard install).echo $PS1->\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$– Bohemian Jun 22 '15 at 00:25PS1also sets the title – muru Jun 22 '15 at 00:25PS1"overrides"PROMPT_COMMAND(if that's true) – Bohemian Jun 22 '15 at 00:26echo $PROMPT_COMMAND? – JBallin Jun 13 '18 at 22:43