mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
Real Virtual env name while using "pipenv".
pipenv is an officially recomended tool for managing python packages dependencies. In pipenv we have an option to create virtual env inside the project it self. The created virutal env name is .venv. The normal bash display the name of the virual env as the parent folder name. Ex: new_shell/.venv then the virual env name displayed in base is new_shell. In powerline_shell the virtual env name is displayed as .venv. This PR is a fix for displaying the parent folder as virtual env name.
This commit is contained in:
parent
2f58402464
commit
21cfded8aa
|
|
@ -7,6 +7,9 @@ class Segment(BasicSegment):
|
|||
env = os.getenv('VIRTUAL_ENV') \
|
||||
or os.getenv('CONDA_ENV_PATH') \
|
||||
or os.getenv('CONDA_DEFAULT_ENV')
|
||||
if os.getenv('VIRTUAL_ENV') \
|
||||
and os.path.basename(env) == '.venv':
|
||||
env = os.path.basename(os.path.dirname(env))
|
||||
if not env:
|
||||
return
|
||||
env_name = os.path.basename(env)
|
||||
|
|
|
|||
Loading…
Reference in a new issue