Meanwhile VSCode's terminal still leaks Electron fds: <a href="https://github.com/microsoft/node-pty/issues/657">https://github.com/microsoft/node-pty/issues/657</a><p>I get this proposal's rationale, but it seems that it would implicitly make fd leaks more prone in python programs
Of all the quirks with process spawning in posix keeping file descriptors open is the most problematic one I encountered. This bit into my ass while implementing a C library to have proper process spawning and stdio handling in LUA. I really wish file descriptors were non inheritable by default.
Go goes slightly further and opens all descriptors with O_CLOEXEC by default, so if you ever execute an external command you have to go out of your way to preserve any descriptors, which is really nice in my opinion
FDs really should have been opt-in for inheritability from the start, with the possible exception of stdio. Inheritability being an fcntl is definitely one of the worst bits -- if the APIs for fork()/etc were designed today it would probably take a list of FDs that would be dup2'd in the new child process.
Dang: Link should be <a href="https://github.com/python/cpython/issues/86904">https://github.com/python/cpython/issues/86904</a>