I’ve been looking for this a few times without success. There are some nasty proposals with setting PS1 variable or other tricks with .bashrc mods. Weak and doesn’t actually work.
I needed a way to make a bash script that opens several tabs with fixed titles and with fixed start directories and with already started programs (for example tail/less of log files). Or solutions are very complicated.
There’s a simple way.
There’s a nice option for gnome-terminal -t “Tab title” which allows you to set a title for a tab. But in default profile (a switchable terminal behavior configuration) any program or bash prompt can change tab’s title. So actually setting tab title doesn’t work permanently.
A good solution is to create a new profile (let’s call it “NoTitleChange”) with options set to not to allow tab change. To do this, in gnome-terminal go to Edit->profiles… click New, apply new name. Then in tab Title and Command from drop box (When commands set own title…) choose Keep initial title.
Now you can invoke
gnome-terminal –tab-with-profile=NoTitileChange -t “My Permanent title”
Execute the argument to this option inside the terminal.
Set the terminal’s working directory to DIRNAME.
X geometry specification (see “X” man page), can be specified once per window to be opened.
gnome-terminal –tab-with-profile=NoTitleChange -t “src” –working-directory=/opt/workspace/play/mnp/repo/console_gxt2/mnpc –tab-with-profile=NoTitleChange -t “DevMode” –working-directory=/opt/workspace/play/mnp/repo/console_gxt2/mnpc –command=”mvn initialize exec:exec -Pdevel”