Add Poetry support to virtualenv

Heavily based on #1994.

Integrate Poetry virtualenv detection into the existing virtualenv
segment. For poetry virtualenvs, use the package name as reported by
`poetry version`.
This commit is contained in:
Alex Jurkiewicz 2023-10-12 13:33:59 +08:00
commit e3e5605a61
6 changed files with 51 additions and 15 deletions

View file

@ -944,6 +944,8 @@
# If set to "false", won't show virtualenv if pyenv is already shown.
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false
# Check for virtual environments managed by poetry
typeset -g POWERLEVEL9K_VIRTUALENV_ENABLE_POETRY=true
# Separate environment name from Python version only with a space.
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# Custom icon.

View file

@ -922,6 +922,8 @@
# If set to "false", won't show virtualenv if pyenv is already shown.
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false
# Check for virtual environments managed by poetry
typeset -g POWERLEVEL9K_VIRTUALENV_ENABLE_POETRY=true
# Separate environment name from Python version only with a space.
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# Custom icon.

View file

@ -918,6 +918,8 @@
# If set to "false", won't show virtualenv if pyenv is already shown.
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false
# Check for virtual environments managed by poetry
typeset -g POWERLEVEL9K_VIRTUALENV_ENABLE_POETRY=true
# Separate environment name from Python version only with a space.
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# Custom icon.

View file

@ -93,6 +93,8 @@
# Don't show Python version.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# Check for virtual environments managed by poetry
typeset -g POWERLEVEL9K_VIRTUALENV_ENABLE_POETRY=true
# Blue current directory.
typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue

View file

@ -988,6 +988,8 @@
# If set to "false", won't show virtualenv if pyenv is already shown.
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false
# Check for virtual environments managed by poetry
typeset -g POWERLEVEL9K_VIRTUALENV_ENABLE_POETRY=true
# Separate environment name from Python version only with a space.
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# Custom icon.