mamba icon indicating copy to clipboard operation
mamba copied to clipboard

Backport better support for prefixes with spaces

Open wolfv opened this issue 3 years ago • 1 comments

@jaimergp made a neat PR to fix things in conda: https://github.com/conda/conda/pull/11676/files

wolfv avatar Sep 30 '22 09:09 wolfv

Be aware of this regression: https://github.com/conda/conda/issues/11885

We have a fix in the way, so just wait a bit while we implement it :D

jaimergp avatar Oct 05 '22 15:10 jaimergp

This was finally tackled with a conda-specific workaround (https://github.com/conda/conda/pull/12043) so I think you can implement it safely in micromamba (since it needs no shebang itself).

jaimergp avatar Jan 09 '23 18:01 jaimergp

So you just use /usr/bin/env if there is a space?

wolfv avatar Jan 09 '23 18:01 wolfv

Only for the $BASE_PREFIX/bin/conda[-env] entry points created by conda init (this is restoring the old behavior). Otherwise $PS1 is dropped in CentOS7.

This approach won't allow people to run $BASE_PREFIX/bin/conda from non-initialized activations if $BASE_PREFIX contains spaces. The most robust workaround is in https://github.com/conda/conda/pull/11995, but it's a complete overhaul.

Note this is only important for the initialized base conda installation, which is controlled by whatever constructor allows. However, now it's possible to create environments that contain spaces and the entry points should also work without prior env activation.

jaimergp avatar Jan 09 '23 18:01 jaimergp

I made a PR: #2211 let me know what you think :)

wolfv avatar Jan 09 '23 18:01 wolfv

This can be closed now, right?

jaimergp avatar Jan 19 '23 22:01 jaimergp