PS1 isn't reset if empty #407

Closed
shish opened this Issue Mar 13, 2013 · 1 comment

Projects

None yet

2 participants

@shish
shish commented Mar 13, 2013

If one activates a virtualenv while PS1 is empty (eg a non-login shell), then deactivates it, the environment name will be left in the prompt. This can then cause lots of confusion as scripts assume "PS1 is non-empty" == "interactive shell"

$ export PS1=
. myEnv/bin/activate
(myEnv) deactivate
(myEnv) # env name is still here after deactivate
$ export PS1=moo
moo . myEnv/bin/activate
(myEnv)moo deactivate
moo # env name is gone
@pfmoore pfmoore was assigned Mar 13, 2013
@pfmoore
Member
pfmoore commented Mar 14, 2013

A fix for this looks reasonably easy. I'll try to sort out a patch for it.

@blueyed blueyed added a commit to blueyed/virtualenv that referenced this issue Mar 2, 2015
@blueyed blueyed activate.sh: handle empty (but set) vars
Fixes pypa#407
376e07e
@Ivoz Ivoz added a commit that closed this issue Sep 19, 2015
@Ivoz Ivoz Account for defined but empty shell variables
Fixes #407, Thanks to #723
b31caa2
@Ivoz Ivoz closed this in b31caa2 Sep 19, 2015
@willingc willingc added a commit to willingc/virtualenv that referenced this issue Oct 10, 2015
@Ivoz @willingc Ivoz + willingc Account for defined but empty shell variables
Fixes #407, Thanks to #723
5c3f832
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment