For the benefit of the reader: The answer from @Feiteira used to be the correct answer, but is no more supported by gnome-terminal
. Option --disable-factory
got removed from gnome-terminal
.
To explain the different observation of several people here:
gnome-terminal
only blocks, if it is the first instance of it. This single instance then acts as a server for all future invocations of gnome-terminal
. Those other gnome-terminal
calls then hand everything over to this server and immediately terminate. So you can observe both behavior: "blocking" (when it is the one-and-only single instance) and "nonblocking" (when another instance is already running).
There is a wrapper, for example used by Ubuntu 16.04, which emulates this missing option. However this wrapper is complex. This is done by starting another server (with another service name). And for this server, the same assumption holds (you can attach other gnome-terminal
s to this server, and those others then come back immediately as well).
My suggestion is to stop using gnome-terminal
and to switch to something, which works right out of the box. For example xfce4-terminal
officially supports all those little absolutely necessary options for a mature terminal window:
xfce4-terminal --disable-server -x nano test.txt
Also xfce4-terminal
introduces --hold
which allows you to see the output of a command. Sadly --hold
has a bug (at least under Ubuntu 16.04), which causes it to (often) truncate the output (the terminal is closed too early if a command terminates, so all still buffered output of the PTY does not make it to the window. This is a very well known common bug if you are not careful enough with PTYs).