From f34834e51f028f87b955269e4f1664f313070b71 Mon Sep 17 00:00:00 2001 From: Yonnie Lu Date: Tue, 28 Nov 2023 18:00:44 +0800 Subject: [PATCH] Add miniconda ENV support - Add miniconda `CONDA_DEFAULT_ENV` support, if this variable exists, it'll override `VIRTUAL_ENV` to let the venv work - If venv name is `base` (default name for miniconda) the venv part will be hidden --- jovial.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jovial.zsh-theme b/jovial.zsh-theme index dc93884..49a90af 100644 --- a/jovial.zsh-theme +++ b/jovial.zsh-theme @@ -456,7 +456,11 @@ typeset -gA jovial_affix_lengths=() } @jov.set-venv-info() { - if [[ -z ${VIRTUAL_ENV} ]]; then + if [ ! -z $CONDA_DEFAULT_ENV ]; then + export VIRTUAL_ENV=$CONDA_DEFAULT_ENV + fi + + if [[ -z ${VIRTUAL_ENV} || ${VIRTUAL_ENV} == "base" ]]; then jovial_parts[venv]='' else jovial_parts[venv]="${JOVIAL_AFFIXES[venv.prefix]}${JOVIAL_PALETTE[venv]}$(basename ${VIRTUAL_ENV})${JOVIAL_AFFIXES[venv.suffix]}"