Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add miniconda ENV support #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion jovial.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,11 @@ typeset -gA jovial_affix_lengths=()
}

@jov.set-venv-info() {
if [[ -z ${VIRTUAL_ENV} ]]; then
if [ ! -z $CONDA_DEFAULT_ENV ]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could move checking 'base' name related to CONDA_DEFAULT_ENV.
Those modifies separates the checks for the CONDA_DEFAULT_ENV variable and its value being 'base',
but that's unnecessary for hidden with virtualenv lib.

if [[ -n ${CONDA_DEFAULT_ENV} && ${CONDA_DEFAULT_ENV} != "base" ]]; then

export VIRTUAL_ENV=$CONDA_DEFAULT_ENV
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting export VIRTUAL_ENV=$CONDA_DEFAULT_ENV seems like a bad idea because the two variables do not sync with each other. When deactivating with Conda, the VIRTUAL_ENV variable is not reset.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, theme move the condaenv in top of the line, like the following screenshot:
CleanShot 2024-07-15 at 19 31 58

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

II think the (base) env shoud be placed in the right of the arrow

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]}"
Expand Down