@@ -19,15 +19,15 @@ While the virtualenv ``activate`` script does attempt to provide
19
19
an indicator in the prompt, it has various shortcomings, and
20
20
cannot be customized.
21
21
22
- However, it does also set a shell variable named
22
+ However, it does also set a shell variable named
23
23
``VIRTUAL_ENV `` which can be used as the basis for disabling the
24
24
built-in prompt indicator and substituting an improved one,
25
25
as a customization to ``.bashrc `` or ``.zshrc ``::
26
26
27
27
virtualenv_prompt() {
28
28
# If not in a virtualenv, print nothing
29
29
[[ "$VIRTUAL_ENV" == "" ]] && return
30
-
30
+
31
31
# Distinguish between the shell where the virtualenv was activated
32
32
# and its children
33
33
local venv_name="${VIRTUAL_ENV##*/}"
@@ -37,7 +37,7 @@ as a customization to ``.bashrc`` or ``.zshrc``::
37
37
echo "<${venv_name}> "
38
38
fi
39
39
}
40
-
40
+
41
41
# Display a "we are in a virtualenv" indicator that works in child shells too
42
42
VIRTUAL_ENV_DISABLE_PROMPT=1
43
43
PS1='$(virtualenv_prompt)'"$PS1"
@@ -116,10 +116,6 @@ directory each time he runs ``cd``. If it finds a ``.venv`` file, it
116
116
activates the environment named within. On leaving that directory,
117
117
the current virtualenv is automatically deactivated.
118
118
119
- `Harry Marr <http://hmarr.com/about/ >`__
120
- wrote a similar function that works with `git repositories
121
- <http://hmarr.com/2010/jan/19/making-virtualenv-play-nice-with-git/> `__.
122
-
123
119
Installing Common Tools Automatically in New Environments
124
120
=========================================================
125
121
0 commit comments