Skip to content

added conda virtual env name to prompt #84

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

Merged
merged 2 commits into from
Sep 23, 2020

Conversation

GPSBach
Copy link
Contributor

@GPSBach GPSBach commented Sep 23, 2020

Currently, conda doesn't set the $VIRTUAL_ENV variable when activating an environment, instead storing the same information under $CONDA_PREFIX. Added this to the script so that the names of conda environments will be displayed.

Note: the order of the if/elif statement means that $VIRTUAL_ENV will supercede $CONDA_PREFIX if both exist...I am not sure if or when this happens e.g. activating a virtualenv environment from within a conda environment. Because there are so many environment managers, i haven't checked the interplay between each and conda.

@reobin
Copy link
Owner

reobin commented Sep 23, 2020

Hi @GPSBach !

Thanks for the PR!

Since both are used in python environments, I think the behavior you chose makes the most sense.

@GPSBach
Copy link
Contributor Author

GPSBach commented Sep 23, 2020

As far as testing goes, do you have a framework in mind or should I just muck around and test on my own computer?

@reobin
Copy link
Owner

reobin commented Sep 23, 2020

No automatic tests exist at the moment, but it’s definitely I want to try to do one day. Pretty challenging stuff testing a prompt, but definitely doable.

Once it’s up to date, I’ll play around with virtual env on my side to make sure it works great. If you have the same results
on your side with conda, I‘ll consider the feature ready. No extensive testing is needed here

@GPSBach
Copy link
Contributor Author

GPSBach commented Sep 23, 2020 via email

@reobin
Copy link
Owner

reobin commented Sep 23, 2020

Working well on my end too!

Thank you @GPSBach !

@reobin reobin merged commit bf4a813 into reobin:main Sep 23, 2020
@reobin
Copy link
Owner

reobin commented Sep 23, 2020

@all-contributors please add @GPSBach for code and ideas

@allcontributors
Copy link
Contributor

@reobin

I've put up a pull request to add @GPSBach! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants