File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,20 @@ The ``predeactivate`` script is source before the current environment is deactiv
58
58
be used to disable or clear settings in your environment. ``$VIRTUAL_ENV`` refers to the old
59
59
environment at the time the script runs.
60
60
61
+ $WORKON_HOME/postactivate
62
+ =============================
63
+
64
+ The global ``postactivate`` script is sourced after the new environment is enabled and the new
65
+ environment's postactivate is sourced (if it exists). ``$VIRTUAL_ENV`` refers to the new
66
+ environment at the time the script runs.
67
+
68
+ This example script adds a space between the virtual environment name and your old PS1 by making
69
+ use of ``_OLD_VIRTUAL_PS1``.
70
+
71
+ ::
72
+
73
+ PS1="(`basename \"$VIRTUAL_ENV\"`) $_OLD_VIRTUAL_PS1"
74
+
61
75
$WORKON_HOME/premkvirtualenv
62
76
=============================
63
77
@@ -104,6 +118,7 @@ Updates
104
118
105
119
1.10
106
120
- Pull in fix for colorized ls from Jeff Forcier (b42a25f7b74a).
121
+ - Add global postactivate hook.
107
122
108
123
1.9
109
124
- Add more hooks for operations to run before and after creating or deleting environments based on changes from Chris Hasenpflug.
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ mk_test_hook premkvirtualenv
15
15
mk_test_hook postmkvirtualenv
16
16
mk_test_hook prermvirtualenv
17
17
mk_test_hook postrmvirtualenv
18
+ mk_test_hook postactivate
18
19
19
20
echo
20
21
echo " HOOKS:"
Original file line number Diff line number Diff line change @@ -145,6 +145,9 @@ function workon () {
145
145
source "$activate"
146
146
147
147
virtualenvwrapper_source_hook "$VIRTUAL_ENV/bin/postactivate"
148
+
149
+ virtualenvwrapper_source_hook "$WORKON_HOME/postactivate"
150
+
148
151
return 0
149
152
}
150
153
You can’t perform that action at this time.
0 commit comments