]> git.phdru.name Git - dotfiles.git/blobdiff - .shellrc
.procmailrc: Add generateds-users mailing list
[dotfiles.git] / .shellrc
index ff089415d0369a3b135b17ab5f2a73b133d22327..9507b48ea3f6fb3ac02f56d2627a0db1a0aa5ed4 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -164,6 +164,11 @@ if test -n "$BASH_VERSION"; then
       . "$VIRTUAL_ENV/bin/activate"
    fi
 
+   # Clean up python virtual environment on exit
+   # See https://virtualenvwrapper.readthedocs.io/en/latest/tips.html#clean-up-environments-on-exit
+
+   trap '[ "$VIRTUAL_ENV" ] && deactivate' EXIT
+
 elif test -n "$KSH_VERSION" -o -n "$FCEDIT"; then
    back() { cd - "$@"; }
    j() { jobs; }