mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.88k stars 353 forks source link

tcsh not supported by mamba init (listed as supported in help) #2678

Open dwhswenson opened 1 year ago

dwhswenson commented 1 year ago

Troubleshooting docs

How did you install Mamba?

Mambaforge

Search tried in issue tracker

mamba init tcsh

Latest version of Mamba

Tried in Conda?

I do not have this problem with Conda, just with Mamba

Describe your issue

mamba init --help lists several supported shells (inherited from conda): [bash, fish, powershell, tcsh, xonsh, zsh]. However, tcsh is not correctly supported.

With tcsh as the shell, mamba_shell_init.py uses MAMBA_SNIPPET_SH, since there's a special case for fish and everything else is treated the same:

https://github.com/mamba-org/mamba/blob/6f6fdd7b982d7bebfc5ffb982cfa3d2849977209/mamba/mamba/mamba_shell_init.py#L13-L17

This is invalid syntax in tcsh. Even fixing that snippet, you will probably need to bring in a shell_templates/mamba.csh similar to conda.csh.

Supporting tcsh would be the preferred solution, but preventing unsupported shells from being listed in mamba init --help (presumably by modifying conda.base.constants.COMPATIBLE_SHELLS?) would also solve.

mamba info / micromamba info

No response

Logs

No response

environment.yml

No response

~/.condarc

No response

kxmh42 commented 1 year ago

It looks like some parts of the code allow only "tcsh" and not "csh" as an argument:

https://github.com/mamba-org/mamba/blob/14aa49012a7cc61c5282dfc01e2f36b24e46b319/micromamba/src/shell.cpp#L33C15

but other parts of the code accept only "csh" and not "tcsh":

https://github.com/mamba-org/mamba/blob/14aa49012a7cc61c5282dfc01e2f36b24e46b319/libmamba/src/core/shell_init.cpp#L1031