-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
themes/agnoster : pyenv not properly detected/shown #458
themes/agnoster : pyenv not properly detected/shown #458
Conversation
Add Pyenv detection to agnoster: - if pyenv is not initialized, fall back to the virtualenv detection - when pyenv is set to a version other than "system", show the version number - when pyenv is in virtulenv mode, also display the virtualenv's name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! Could you check the following comments?
Also, you might want to submit similar changes to the upstream speedenator/agnoster-bash
.
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating! These are the second round of comments.
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
I tested both suggestions, seems fine as far as I can tell, so I added both. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thank you for the comments and suggestions. ^^ |
At the moment, agnoster relies on
$VIRTUAL_ENV
to detect virtualenvs, but it is unreliable when using pyenv. With a named pyenv virtualenv, it properly detects we are in a virtualenv, and sets the prompt as[v] <version>
; when using a non-system version, it fails to detect the version ($VIRTUAL_ENV
is not set) and hides the python segment.Ideally (I think), pyenv should be treated and displayed somewhat like conda is: when a non system version is used, grab the python version, and when in a virtualenv, show its name and version.
This PR adds Pyenv detection to agnoster:
I'm not particularly proficient with bash, so the whole thing can probably be improved, but as far as I could test, it works. Since I don't use conda, it would likely require some extra testing to see how the two interact and check that it doesn't break the conda display.