After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 461865 - gnome terminal: child processes also killed when main window is closed via "X" button
gnome terminal: child processes also killed when main window is closed via "X...
Status: RESOLVED DUPLICATE of bug 168320
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-30 16:43 UTC by Wirawan Purwanto
Modified: 2015-03-23 10:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Wirawan Purwanto 2007-07-30 16:43:25 UTC
GNOME terminal running BASH shell would cause all child processes to be killed when the terminal window that started the processes is closed via "X" button. This does not happen if we use, e.g. Ctrl+D or "exit" command from the shell. I will specifically refer to gnome terminal found in UBUNTU 7.04 here (but see the note below).

STEPS TO REPRODUCE

To reproduce this problem, follow these steps:

* Open GNOME Terminal, e.g. from menu item Applications::Accessories::Terminal. Make sure you're using /bin/bash as the shell!

* Now open one of your favorite X applications (it doesn't matter -- firefox, gedit, xpdf, etc.). Let's take gedit here as an example. Type
    gedit &
in the terminal window. This will background the gedit process.

* Switch back to the GNOME terminal, and press the "X" (close) button on its title bar

* Result: Not only GNOME terminal is closed, but all the apps that were started from the terminal prompt will close!

The result is VERY undesirable for me. Suppose we are in the middle of editing something in gedit, and forgot to save. Then if accidentally I pressed the "X" of the starting gnome terminal, everything is lost without warning!

I don't know whether to categorize this as a bug or usability. But to be gentle, I start with usability problem report. I strongly suggest the following:

* Fix the problematic interaction between bash/gnome-terminal, so that when the terminal is closed via the "X" button on the title bar, the child processes are not killed (just like if we press Ctrl+D).

* Make the current behavior an option via Terminal menu for those liking this behavior (huh?).

Other information:
Notes/observations:

1. The same problem is reproduced if we use menu File::Close Window (Shift+Ctrl+Q) to close the terminal window.

2. If we type "exit" on the shell prompt, or Ctrl+D, then the gnome terminal window would close, but not the child processes (gedit, in this case).

3. If we kill the "gnome-terminal" parent process of the shell from another terminal, then the child processes are not terminated.

4. If we use tcsh as the shell, this problem seems to not appear at all. I don't know about other shells.

5. I found that several X applications are resistant to the plague described above. I have tested xterm and gv ; they did not close even if gnome-terminal is closed via the "X" button.

I have noticed this problem long enough, so I would say that most versions of gnome terminal (dated to that existing in SuSE 9.2) are affected. I am using UBUNTU 7.04 right now, so use gnome-terminal that comes with that as a concrete example.
Comment 1 Wirawan Purwanto 2008-05-29 21:15:30 UTC
I note that xfce4-terminal also exhibits the same behavior (version 0.2.6, XFCE version 4.4. Built with Gtk+-2.10.11, running with Gtk+-2.10.11). I wonder if this problem is due to "vte" component, which is being used in both gnome-terminal and xfce4-terminal.

Wirawan
Comment 2 Wirawan Purwanto 2008-09-01 00:49:39 UTC
Why was the version changed to "unspecified"? Is that because it is not specific to 2.18?
Comment 3 Debarshi Ray 2015-03-23 10:11:22 UTC

*** This bug has been marked as a duplicate of bug 168320 ***