This requires a two step process.
- you need to start
gnome-terminal
running a program that waits for commands to be "sent in"
- you need to speak to said program to make it execute the things you want it to execute.
The right syntax to start gnome-terminal
with a command to execute is
gnome-terminal -- command
not gnome-terminal --command
as you did.
Having sorted out how to do 1., we need to find a program that does serves as a daemon that will listen to commands being sent in.
tmux
is such a server. You can run
gnome-terminal -- tmux -L 'a unique name for a socket'
to start your gnome-terminal with an empty shell inside.
You can then use tmux
' CONTROL MODE to send commands to that tmux server, e.g. to attach to the session currently displayed in the gnome-terminal, then make a new frame in that, running your command of choice in that frame. See man tmux
for more detail.
Honestly, though:
gnome-terminal
is an interactive terminal emulator. You just seem to want to display some output in a graphical manner; you don't seem to expect gnome-terminal
to get input from the user. The right thing to do in that case is simply not use gnome-terminal, but use whatever you're planning to use to send commands to display a window with a constant-width font text field, and print whatever output you want there.