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
Implement VIRTUAL_ENV_DISABLE_PROMPT or something covering the same use case(s) #1229
Comments
The function that sets the environment part of the prompt is here: Line 1120 in 3d9e844
I guess it could just check that environement variable exist: |
Yes, but should it do it in the prompt template(s) or in env_name()? Is the output of env_name() exposed anywhere? Perhaps the difference in semantics is sufficient that there should be an xonsh specific env var with the closest functionality available. Hm. Or perhaps display a message saying how to alter your prompt so it doesn't include the virtualenv name if your prompt template contains {env_name}? I need to look more closely at how prompts are specified. Here's where it was added to virtualenv (not super enlightening that I could see) pypa/virtualenv#5 |
|
Question: it seems like |
@gforsyth It's not at env creation, but at env activation. |
I don't use virtualenv and can't test this right now, but the documentation you linked to in the initial post indicates otherwise:
But I would not be surprised if the docs were out-of-date / incomplete / wrong. |
I managed to get the effect I wanted with
Though I could have used the even more succinct |
See https://virtualenv.pypa.io/en/stable/reference/#configuration
Handy if, e.g. installing and running xonsh in a VE using --system-site-packages. The prompt is displayed by xonsh, so I guess it'd need to be set in environ.py, but I'm not sure whether it would be best as a change to env_name() or to the prompt templates when env['VIRTUAL_ENV_DISABLE_PROMPT'] is set to anything but ''. The original reportedly prevents activate from modifying the shell prompt, but I can't see a direct equivalent to that (xonsh can't parse or do clever sub-shell things with bash/zsh/*sh prompt strings can it?).
The text was updated successfully, but these errors were encountered: