necaris / conda.el

Emacs helper library (and minor mode) to work with conda environments
MIT License
153 stars 49 forks source link

Prefix is not added in shell prompt in Emacs 29.0.60 #138

Open louisdecharson opened 1 year ago

louisdecharson commented 1 year ago

I've upgraded to Emacs 29.0.60 and the conda prefix on the shell prompt is not there anymore. Using conda-env-activate does activate the correct python environment (see screenshot) but the prefix is not added to the prompt. Activating manually within the shell the conda environment does add the prefix so it's probably a command missing from conda.el.

image

necaris commented 1 year ago

@louisdecharson can you confirm if you're using the same version of conda.el in both versions of Emacs? And which shell are you using (eshell, vterm, etc)?

louisdecharson commented 1 year ago

Hi @necaris, I am using the same version of conda.el and I am using shell, the inferior shell with zsh and oh-my-zsh (the issue is the same with term and eshell).

louisdecharson commented 1 year ago

Hi @necaris, I've been experimenting a bit around this and I've observed the following:

See also the screenshots below.

My current understanding is that conda.el is adding the conda env path to the $PATH which then results in $__conda_setup not working anymore, i.e. not adding /path/to/anaconda3/condabin to the $PATH when ~/.zshrc is ran.

I've managed to make it work for shell by changing in conda.el (function conda--shell-strip-env)

(if (or buffer-exists-already (not conda-env-current-path))

by

(if (not conda-env-current-path)

BEFORE ACTIVATING ENV WITH conda-env-activate the path to the conda env /Users/louis_de_charsonville/opt/anaconda3/envs/py39/bin is correctly added Screenshot 2023-01-14 at 00 16 33

AFTER ACTIVATING ENV WITH conda-env-activate the path to the conda env is not added. Note also that /Users/louis_de_charsonville/opt/anaconda3/condabin is not the first item of $PATH either, revealing that $__conda_setup has not worked.

Screenshot 2023-01-14 at 00 17 08

Let me know what I can try to debug it further or if you have any idea what's happenning