Gabriella439 / turtle

Shell programming, Haskell style
BSD 3-Clause "New" or "Revised" License
943 stars 90 forks source link

`cd` and `export` are global and not per thread #388

Closed bfrk closed 4 years ago

bfrk commented 4 years ago

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.

Gabriella439 commented 4 years ago

The fix is up here: https://github.com/Gabriel439/Haskell-Turtle-Library/pull/389