Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable prompt update in activate script #5

Closed
vbabiy opened this issue Mar 14, 2011 · 4 comments
Closed

Option to disable prompt update in activate script #5

vbabiy opened this issue Mar 14, 2011 · 4 comments

Comments

@vbabiy
Copy link

vbabiy commented Mar 14, 2011

I like the idea of updating the bash prompt to include the name of the current environment when you run an activate script. But I've got my own nice, colorized prompt, so I'd like to customize how the virtualenv environment name gets added to the prompt.

It seems like the easiest solution would be to add a new environment variable — such as VIRTUAL_ENV_DISABLE_PROMPT — and not do the PS2 magic when this variable is set. That way, my existing prompt definition can check for the existence of VIRTUAL_ENV, and include that as necessary.


@vbabiy
Copy link
Author

vbabiy commented Mar 14, 2011

I created a patch that implements this:

https://bitbucket.org/dcreager/virtualenv/changeset/bcc84d4f18f9/


Original Comment By: Douglas Creager

@vbabiy
Copy link
Author

vbabiy commented Mar 14, 2011

  • Changed status from new to resolved.

Original Comment By: Jannis Leidel

@vbabiy
Copy link
Author

vbabiy commented Mar 14, 2011

If this issue was resolved, how does one get this functionality in virtualenv?
Using VIRTUAL_ENV_DISABLE_PROMPT ?


Original Comment By: Joseph Turian

@vbabiy
Copy link
Author

vbabiy commented Mar 14, 2011

Joseph: Looks like it. I spent the time to grok the source and it's in there:

if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then

So, it will only muck around with your $PS1 if $VIRTUAL_ENV_DISABLE_PROMPT is
not set (or if it is set to an empty string). Thusly, export
VIRTUAL_ENV_DISABLE_PROMPT=1 should do the trick.


Original Comment By: Anonymous

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant