Script to run a command in a terminal and then open a new terminal tab and run another command

Solution 1:

Although gnome-terminal indicates that the -e option is deprecated, it still works in 3.40.3.

# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
# Use “-- ” to terminate the options and put the command line to execute after it.

Developers seem to forget that this is the only way to do what you want, i.e., automatically set up different working environments in tabs. The "new" syntax, that adds commands to run at the end of the options after -- does not allow to do that. Once the -e option is removed, you will need to move to another terminal emulator for something like this.

So this, for example, still works thus far:

gnome-terminal --tab -e "htop" --tab -e "top"

Replace commands htop and top by your custom scripts.