14

After upgrading from Ubuntu 17.04 to 17.10, I get a warning about that option -e is deprecated when starting gnome-terminal from the command line. For example, assume I want to open a gnome-terminal with two tabs, and running separate commands in each tab:

$ gnome-terminal --tab --active -e 'bash -c "echo Hello; exec bash"' --tab -e 'bash -c "echo Hello2; exec bash"'
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.
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.

But how can I run separate commands for each tab if I am supposed to use -- to terminate the options? For example, the following does not work:

$ gnome-terminal --tab --active -- bash -c "echo Hello; exec bash" --tab -- bash -c "echo Hello2; exec bash"

It just opens a single tab.

Håkon Hægland
  • 3,843
  • 12
  • 44
  • 78
  • 1
    You should report bug on `gnome-terminal` package to [bugs.launchpad.net](http://bugs.launchpad.net) with `ubuntu-bug` and/or upstream. This functionality works in `mate-terminal`. – N0rbert Oct 23 '17 at 12:30
  • 1
    @Norbert Added report: https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1726380 – Håkon Hægland Oct 23 '17 at 12:47
  • 1
    Upstream bug report: https://bugzilla.gnome.org/show_bug.cgi?id=784925 – egmont Oct 23 '17 at 12:56
  • 1
    I merged bugs on [bug 1726380 at launchpad.net](https://bugs.launchpad.net/gnome-terminal/+bug/1726380), thanks! – N0rbert Oct 23 '17 at 13:15
  • 3
    but does `gnome-terminal --tab --active -- bash -c "echo Hello; exec bash"` + `gnome-terminal --tab --active -- bash -c "echo Hello2; exec bash"` do what you want? – tatsu Jun 17 '19 at 13:56
  • Looking at the man page, the command is formatted as a string. Have you tried enclosing the whole command in quotes before specifying the rest? – Tim Mar 20 '21 at 23:02

1 Answers1

1

I think the following command would do the trick for you:

gnome-terminal --tab --active -- bash -c "echo Hello; exec bash" && gnome-terminal --tab -- bash -c "echo Hello2; exec bash"
Muhammed Özen
  • 421
  • 2
  • 7