This commit is contained in:
Max Fan 2022-09-27 18:57:19 +09:00 committed by GitHub
commit b4d2434b09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,9 +7,14 @@ 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 os.getenv('POWERLINE_ENV_NAME'):
env = os.getenv('POWERLINE_ENV_NAME')
if not env:
return
env_name = os.path.basename(env)