Skip to content

Commit bc9b565

Browse files
committed
Merged in kojiromike/virtualenvwrapper/deactivate-on-logout-tip (pull request #43)
Add Deactivate-on-Logout Tip
2 parents 5c88ad1 + 98f148e commit bc9b565

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/source/tips.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,18 @@ as a ``postdeactivate`` hook (`source
140140

141141
cd () {
142142
builtin cd "$@"
143-
}
143+
}
144+
145+
Clean up environments on exit
146+
=======================================
147+
148+
Via `Michael <https://github.com/kojiromike>`__:
149+
150+
When you use a temporary virtualenv via ``mktmpenv`` or if you have
151+
a `deactivate <http://virtualenvwrapper.readthedocs.org/en/latest/plugins.html?highlight=hooks#post-deactivate>`_ hook, you have to actually run
152+
``deactivate`` to clean up the temporary environment or run the hook,
153+
respectively. It's easy to forget and just exit the shell. Put the
154+
following in ``~/.bash_logout`` (or your shell's equivalent file) to
155+
always deactivate environments before exiting the shell::
156+
157+
[ "$VIRTUAL_ENV" ] && deactivate

0 commit comments

Comments
 (0)