A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
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:
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
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.
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.