Skip to content

Commit 56517a0

Browse files
committed
Unset previously defined cd function rather than redefine it
It is cleaner to unset the previously defined cd function in postdeactivate rather than redefine it since to avoids leaving an unexpected function in the environment after a deactivate. Change-Id: Iac40287ec5290f2f4523004a9d8f0b2a2b981f90
1 parent 3ca89a2 commit 56517a0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

docs/source/tips.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,9 @@ it a proper path then it will do the right thing.
135135

136136
And to finally restore the default behaviour of ``cd`` once you
137137
bailout of a VENV via a ``deactivate`` command, you need to add this
138-
as a ``postdeactivate`` hook (`source
139-
<http://github.com/kdeldycke/dotfiles/commit/80470b>`_)::
138+
as a ``postdeactivate`` hook::
140139

141-
cd () {
142-
builtin cd "$@"
143-
}
140+
unset -f cd
144141

145142
Clean up environments on exit
146143
=======================================

0 commit comments

Comments
 (0)