<div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 27, 2015 at 7:19 PM, Ciprian Dorin Craciun <span dir="ltr"><<a href="mailto:ciprian.craciun@gmail.com" target="_blank">ciprian.craciun@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
I wonder why such a decision to put newly spawned processes in new<br>
sessions / groups than the parent Erlang VM? What is the advantage?<br></blockquote><div><br></div><div>The original decision was made a long time ago (at least before R7B, which is as far back as I can check) and I think it may have something to do with the way terminals work. I found this blog post talking about the issue: <a href="https://blog.nelhage.com/2011/02/changing-ctty/">https://blog.nelhage.com/2011/02/changing-ctty/</a>. If you want an alternative that is more flexible you can use <a href="https://github.com/saleyn/erlexec">https://github.com/saleyn/erlexec</a>, it appears to take care of this case by allowing you to pass an option specifying if the child has a terminal or not.</div><div><br></div><div>Regardless, all programs that are started with open_port({spawn}) should anyway listen for a closed stdin/stdout fd in order to determine if the port that handles it has terminated, so if you take care of that case then the case of the emulator terminating takes care of itself. </div><div><br></div><div>Lukas</div></div></div></div></div>