These commands change the global state of the process, so a cd or export in one thread will have an effect on all other threads as well. This is obvious in retrospect, as these commands can run directly in IO, whereas similar libraries like shelly have their own monad transformer to keep this state local. Still, the documentation could make this behavior more explicit as it is quite a pitfall to run into.
These commands change the global state of the process, so a
cd
orexport
in one thread will have an effect on all other threads as well. This is obvious in retrospect, as these commands can run directly inIO
, whereas similar libraries like shelly have their own monad transformer to keep this state local. Still, the documentation could make this behavior more explicit as it is quite a pitfall to run into.