<div dir="ltr">Hello,<div><br></div><div>While looking into a bug on Windows related to os:cmd/1 I found that the behaviour of erlang:open_port when spawning port programs is somewhat strange when it comes to the handling of stdin. In the current implementation if you do this on Unix:</div><div><br></div><div><font face="monospace">> erlang:open_port({spawn,"erl"},[in]).</font></div><div><br></div><div>You will get into a very strange state where the parent erl and the child erl both compete for the input characters put into the terminal. If you do it on Windows theĀ child erl will just spin forever.</div><div><br></div><div>So, I'm thinking of making it so that when not supplying 'out' to erlang:open_port the stdin fd will be closed in the child program or alternatively point to /dev/null. This will more mimic Windows behaviour (though there will be no spinning) and makes more sense in my opinion.</div><div><br></div><div>However, with the change, if you want to spawn an erlang child you need to give it the <font face="monospace">-noinput</font> argument as otherwise, it will exit immediately.</div><div><br></div><div>So the question for you all, will this change break any of your code?</div><div><br></div><div>Lukas</div><div>Erlang/OTP team</div></div>