Set terminal window title in a script

bashscriptterminal

I would like to change the entire title of the terminal window for a particular bash script. I googled out but I couldn't find much more than this suggestion:

printf "\e]0;My Custom Title\a"

After running the line above, my terminal window's title becomes so:

ft1 — My Custom Title — bash — 80×24

But I would like it to become just like this:

My Custom Title

Any ideas?

Best Answer

Open the preferences for Terminal and untick the following flags

enter image description here

If this alone doesn't solve the problem

  • unset PROMPT_COMMAND
  • check whether PS1 (the prompt string) changes the window title as well