Bug 11423 - Some applications started from gnome-terminal exit when gt exits
Summary: Some applications started from gnome-terminal exit when gt exits
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gnome-core
Version: 6.2
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-05-15 20:39 UTC by mw
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2000-05-16 22:27:39 UTC

Attachments (Terms of Use)

Description mw 2000-05-15 20:39:34 UTC
If I start an Emacs from a gnome-terminal, and then exit the
gnome-terminal, Emacs also exits.  The same happens if I start a
gnome-terminal from the gnome-terminal.

The only *good* application I found was xterm.  Indeed, and xterm started
from a GT does not exist when GT exits.

Comment 1 Havoc Pennington 2000-05-15 21:02:59 UTC
This is how shells work; if you start a job from a shell, then exit the
shell, normally the jobs are all killed. If you want the job to outlast the
shell, use the "disown" command or the "nohup" command - I'll let you
check out the man pages for those.

Comment 2 mw 2000-05-16 20:10:59 UTC
I did not know that gnome-terminal is a shell...

So what if I start several applications from a gnome-terminal, and then,
noticing that the applications clutter up my screen, I quit the gnome-terminal,
and suddenly all my applications are gone (except good old xterm).

In other words, it is expected that the user remembers which terminal is the
father of which application?!

What is wrong with xterm's behavior which takes advantage of X in that it does
*not* have to behave like a shell?

Comment 3 Havoc Pennington 2000-05-16 22:27:59 UTC
xterm behaves exactly the same way as gnome-terminal
as far as I can see.

If you exit the xterm or gnome-terminal, then the child shell
is killed. Most shells (such as bash) kill child processes
when they exit. tcsh won't kill backgrounded processes; bash won't
kill backgrounded processes if you use the "disown" command.
bash also doesn't kill child processes if you exit the shell
using the control-D shortcut. This behavior has existed for
probably 20 years, and is certainly the right behavior
for shells not running inside an xterm, so I don't think
the shell maintainers will accept a patch to change it.

If you see a difference in how gnome-terminal and xterm
behave, I can look into that, but they work the same on
my computer, so I need more details to figure out why
they seem different on yours.

The "disown" command and the tcsh behavior for background
processes are supposed to solve exactly this problem,
so I would recommend taking advantage of those features.

Note You need to log in before you can comment on or make changes to this bug.