One thing I do to avoid this is to write out the Docker environment to a file in my home directory. Then I source that file, if it exists, for each new terminal session. Not perfect, but you can see it here: <a href="https:&#x2F;&#x2F;github.com&#x2F;bentruyman&#x2F;dotfiles&#x2F;blob&#x2F;392914f92e5a8d8d9fc20cc967aadc1a3971e99b&#x2F;env&#x2F;docker.sh" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bentruyman&#x2F;dotfiles&#x2F;blob&#x2F;392914f92e5a8d8d...</a><p>But DLite appears to resolve a lot of this &#x27;hackiness&#x27;.