]> git.phdru.name Git - dotfiles.git/blobdiff - .bash_logout
.bash_logout: clean up python virtual environment on exit
[dotfiles.git] / .bash_logout
index de4f5f75d7ccd3a5b62bd2ce683ed678a5cb72c2..4c880fdf932a798ea0162e27409fb023fa4ebe95 100644 (file)
@@ -1,5 +1,10 @@
 # ~/.bash_logout: executed by bash(1) when login shell exits.
 
+# Clean up python virtual environment on exit
+# See https://virtualenvwrapper.readthedocs.io/en/latest/tips.html#clean-up-environments-on-exit
+
+[ "$VIRTUAL_ENV" ] && deactivate
+
 # when leaving the console clear the screen to increase privacy
 
 if [ "$SHLVL" = 1 ]; then