How to prevent the application launched in Terminal from undesirably exiting? I launch applications from the Terminal with commands like this one :

/Applications/Mail.app/Contents/MacOS/Mail &amp;

The important part is the &amp;.


For Unix / Linux / Solaris : 


I have learned at school that adding the &amp; makes the program live on his own. 
I strongly remember launching a command like xeyes &amp; and having the program running safe even after I close the shell.

On Mac OS X (Unix inside) : 


I launch an app with &amp; and I close the Terminal window : the application exits ! 
Why does this undesirable behaviour happen on Mac OS X ? 
How can this be fixed ?
The "standard" way of accomplishing what you want to accomplish (on OS X as well as on Linux, FreeBSD or other systems) is to use the command nohup:

nohup program &amp;


This will start program, which will run in the background relative to the shell because of the &amp; - and will ignore hangup signals due to the nohup command.

This way the program will continue running even though you close the shell. It doesn't matter if you're closing the shell because you're closing Terminal.app, or you're closing the shell because you are disconnecting from a ssh connection to the computer, or similar.