I noticed that if the
--command
option is used in recent
gnome-terminal
versions (I'm running Fedora 29 with the distro's current
gnome-terminal-3.30.2-1.fc29.x86_64.rpm
installed), it will output the following message:
# Option “--command” 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.
Our application (a GNOME Shell extension) launches
gnome-terminal
as a "log viewer" for the extension, when requested by the user, by firing off a
GLib.spawn_command_line_async()
containing a command that opens a two-tab
gnome-terminal
window showing two different views of the journal:
GLib.spawn_command_line_async(
'gnome-terminal ' +
'--tab --command "journalctl cmd 1" ' +
'--tab --command "journalctl cmd 2"'
With the removal of --command
, and the advice to place the command to run after a --
options terminator, what will be the supported method of launching a two-tab terminal window in that manner? Will we have to split our single command apart into two, launching them individually?
Having to switch to this:
GLib.spawn_command_line_async('gnome-terminal --tab -- journalctl cmd 1');
GLib.spawn_command_line_async('gnome-terminal --tab -- journalctl cmd 2');
doesn't seem that onerous on the face of it, but turning a formerly-atomic operation into a pair of discrete ones potentially raises all manner of concerns regarding timing and race conditions. What will happen if the second command fires off too quickly, and the window is not yet available to have a second tab added?
I don't care about --command
per se, only about the useful and valued functionality it provides to us. If there's another, equally-effective way to achieve the same outcome we currently have with --command
, then that's all I need. I'm just trying to work out the alternatives now, so that we don't get caught unawares if support for --command
is dropped.