Hacker News new | ask | show | jobs
by wredue 641 days ago
Yeah. This is some weird shit for launching multiple processes and having the first set env vars that the other then pick up.

I think I’d probably be forced to bitch slap a colleague if they designed applications like that.

1 comments

So how do you picture designing a shell or an init process?
I probably should have qualified with “unless they have an extremely good reason for doing so”

That said. Applications likely to be using zdotenv are probably not what you’re talking about here and should not likely be setting env especially since setenv is “dangerous”.

The way you'd do that in Zig is by duplicating and providing that env map to the child process. You wouldn't modify the existing envmap.
You would fork first on POSIX systems.
I've written a shell in zig, you don't need to fork before building the new envmap