OhmNomNom / thyme

A fork of mintty, for the modern world
GNU General Public License v3.0
0 stars 0 forks source link

Background processes are killed upon closing the mintty term #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start a mintty term instance.
2. Type notepad.exe &
3. Close the mintty term.

What is the expected output? What do you see instead?
When running a background process in an XWindows xterm, closing the xterm 
doesn't cause the background processes to be terminated.

What version of the product are you using? On what operating system?
0.6.2 Windows 7 64 Ultimate

Please provide any additional information below.

Since I often use terminals to launch various applications, its a real 
irritant to close the terminal and find that it closes a bunch of 
applications you currently have open.

Original issue reported on code.google.com by dbgr...@gmail.com on 29 Apr 2010 at 3:44

GoogleCodeExporter commented 9 years ago
That's a bash feature actually, and it should be the same behaviour in xterm. 
It is 
for me anyway. You will see a difference though depending on how you close your 
session.

If you close it by typing Ctrl+D or the exit command, bash will leave the 
background 
processes running unless you have the 'huponexit' option set. It's off by 
default. 
(See the bash manual for more on that.)

But if you close it by pressing mintty's or xterm's close button, then a HUP 
signal 
is sent to bash, and bash forwards that to its child processes, independent of 
the 
'huponexit' setting.

You can stop that from happening either on a process-by-process basis using 
'nohup' 
or 'disown', or generally by mapping the HUP signal to 'exit':

trap exit HUP

Original comment by andy.koppe on 29 Apr 2010 at 8:44