self plug: <a href="http:&#x2F;&#x2F;direnv.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;direnv.net&#x2F;</a> does basically the same but without having to start new sub-shells. Just `cd` into a folder, if it has an .envrc file it&#x27;s loaded. If you `cd` out of the folder all the changed environment variables are restored.