If you have gnome-terminal running, and want a new instance of the program, you might think that running gnome-terminal & from a shell would do the trick.

Astonishingly, this new instance behaves like some insipid Windows or Mac program; it only sends a message to the existing, running gnome-terminal to create a new window. If this one gnome-terminal process crashes, you lose all of the terminal windows!

(Of course, each window has its own shell, which is an independent process, but the actual terminal emulator and its GUI are managed from a single instance of the application.)

How can we create independent instances of gnome-terminal, each running in their own process, so that killing that process only destroys the window(s) associated with that process?

  • You may have success with gnome-terminal --disable-factory, however support for it is apparently being witdrawn – steeldriver May 7 '15 at 1:01
  • @steeldriver It seems to be working; care to make it into an answer? I don't care about support being withdrawn. Why is this so hard to find? Because the documentation for --disable-factory doesn't use any standard terminology like "start in a new process (or address space); do not re-use the existing instance". – Kaz May 7 '15 at 1:06
  • Compare unix.stackexchange.com/questions/323663 – JdeBP Nov 17 '16 at 20:02
  • 2
    I can't believe the people running these projects keep making such crappy decisions. Did we learn nothing? Who cares about sparing some kilobytes of RAM? One would think that keeping the terminals from crashing each other should be the #1 priority. Back to rxvt I guess. – Tobia Nov 21 '16 at 12:12
  • In fact, I can recommend rxvt to anybody wanting a true multi-process terminal. It has Truetype font support, re-wrapping of long lines, and most other features of modern terminals. – Tobia Nov 22 '16 at 13:50
up vote 5 down vote accepted

According to man gnome-terminal, the option you're looking for appears to be the confusingly-named

   --disable-factory
             Do not register with the activation name server, do 
             not re-use an active terminal.

However, the option is apparently removed in more recent releases so should not be relied on.

  • This works great. By the time the pinheads remove this feature, I will likely no longer care. I need this in a test setup where more than ten terminal windows are open: some running minicom to various serial lines connecting to embedded devices, and others are sitting in test script directories, and such. gnome-terminal has the best features for resizing with good looking, readable fonts at every size. Unfortunately, it leaks memory like crazy, growing to 2GB in the course of a week. Separate processes will help contain this problem, making it more manageable. – Kaz May 7 '15 at 19:11
  • I tried rxvt, aterm, eterm, xterm, Terminator and a few others. They all easily run as separate processes, of course, but suck in other ways. The documented resizing hotkeys of rxvt wouldn't work. Aterm and xterm plain suck in that department. Terminator has weird resizing that changes the font size without the window size. ETerm just has completely wacky resizing with four fixed fonts; I played with the options for about 30 minutes, then uninstalled it. – Kaz May 7 '15 at 19:13
  • @Kaz xterm + xdotool --window "$WINDOWID"? – Gilles May 7 '15 at 19:52
  • @Kaz You're probably way over it but I highly recommend urxvt over rxvt. And yes, gnome-terminal is still graphically superior but I somehow learned not to miss it. It probably has a lot to do with new window manager (using i3 now but it's not for everyone). – cprn Jan 8 '17 at 0:14

Due to the new client/server architecture (details here) you'll have to start separate instances of gnome-terminal-server. To do that you could use the --app-id switch:

/usr/lib/gnome-terminal/gnome-terminal-server --app-id my.first.Terminal

then use the client (with the same app-id) to create terminals1 inside the new server :

gnome-terminal --app-id my.first.Terminal
gnome-terminal --full-screen --app-id my.first.Terminal
......

Another instance:

/usr/lib/gnome-terminal/gnome-terminal-server --app-id my.second.Terminal

and terminals:

gnome-terminal --geometry 80x24+200+200 --app-id my.second.Terminal
gnome-terminal --app-id my.second.Terminal
.....

Path to gnome-terminal-server might be different on your system.


1: Note that "you have 10 seconds to use the client to create a terminal inside the new server".

  • Can you give a working example or take a look at this question?: unix.stackexchange.com/questions/304269/… – cprn Aug 29 '16 at 16:57
  • @CyprianGuerra - in a gnome-terminal open two tabs: in the first tab run the 1st command in my example (that is to start the new server) then, in less than 10 seconds, switch to the second tab and run the 2nd command (to start a new client) customized per your needs... – don_crissti Aug 29 '16 at 19:36
  • Tabs... I'll try. For now I can tell it doesn't work inside screen. – cprn Aug 30 '16 at 0:39
  • Are the tabs requirement? As in: does the client terminal process have to be a child of the server? – cprn Dec 16 '16 at 14:31
  • @CyprianGuerra - it was just an example, they're not required from what I can see... – don_crissti Dec 16 '16 at 17:49

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.