Allow easily scripting the opening of gnome-terminal tabs, each with a custom title and custom command they run upon opening
See my answer here: https://askubuntu.com/questions/315408/open-terminal-with-multiple-tabs-and-execute-application/1026563#1026563
The old answer no longer works, so I had to come up with an elaborate work-around scheme I call the "New version" which is pretty ridiculous but does work perfectly. Please fix gnome-terminal
to allow something super simple like this intead:
title1="tab 1"
title2="tab 2"
title3="tab 3"
cmd1="cd /etc"
cmd2="cd ~/Documents"
cmd3="cd /usr/local"
gnome-terminal --tab --title="$title1" --command='$cmd1' \
--tab --title="$title2" --command='$cmd2' \
--tab --title="$title3" --command='$cmd3'
to achieve an effect of a single window being opened with 3 tabs, each of which have their respective title and have run their respective command. I have been able to find an elaborate work-around using my so-called "New version" described in my detailed answer above, but it is a pretty big work-around with a lot of pieces.
Be sure to allow the user to easily keep open the tab after running the command too. Something like --keep-open
might be a good option to add, rather than the super hacky ; exec bash;
I currently have to add to the end of each command to keep the window open after running the command.