Use environment variable to identify conda / mamba (#14515)...
Use environment variable to identify conda / mamba (#14515)
Conda and mamba both set an environment variable which refers to the
base environment's executable path, use that in preference to less
reliable methods, but fall back on the other approaches if unable to
locate the executable this way.
Additionally, change the search to look for the bare command name rather
than the command within the top level of the active environment, I'm
dubious this approach works with any current conda / mamba version which
usually place their executable links in a `condabin` directory or
elsewhere not at the same level as the Python executable.
I believe this will also address
https://github.com/ipython/ipython/issues/14350, which I'm also seeing
in a Windows context where the regex fails to parse and causes a
traceback.