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

Add miniconda ENV support #35

wants to merge 1 commit into from

Conversation

flzyup
Copy link

@flzyup flzyup commented Nov 28, 2023

  • 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

- 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
@@ -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

@@ -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
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

Copy link
Author

@flzyup flzyup left a comment

Choose a reason for hiding this comment

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

correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants