conda / conda

A system-level, binary package and environment manager running on all major operating systems and platforms.
https://docs.conda.io/projects/conda/
Other
6.24k stars 1.6k forks source link

Add conda init script to `$XDG_CONFIG_HOME/fish/conf.d/` instead of messing with `config.fish` #12839

Open simonrouse9461 opened 1 year ago

simonrouse9461 commented 1 year ago

Checklist

What is the idea?

When running conda init fish, conda writes a block of init script to $XDG_CONFIG_HOME/fish/config.fish for fish shell integration. However, fish has a better way of modularizing configurations, which is adding standalone scripts to $XDG_CONFIG_HOME/fish/conf.d/. So, instead of parsing and editing $XDG_CONFIG_HOME/fish/config.fish in place, it's easier and safer to create an $XDG_CONFIG_HOME/fish/conf.d/conda.fish when running conda init fish.

Why is this needed?

$XDG_CONFIG_HOME/fish/config.fish is intended to be edited manually. For modular shell integrations, $XDG_CONFIG_HOME/fish/conf.d/ is a better place.

What should happen?

Create or update $XDG_CONFIG_HOME/fish/conf.d/conda.fish when running conda init fish instead of editing $XDG_CONFIG_HOME/fish/config.fish in place.

Additional Context

No response

origintopleft commented 1 year ago

If it's at all possible, I'd like a more general approach to putting conda init output in a different file, as well; I'm a zsh user with a self-updating zshrc that would like to simply run conda init zsh -f ~/.zshrc.local to prevent my own zshrc updates from clobbering it.

I'm willing to open another issue if needed, I just wasn't sure if it would be a duplicate of this one or not.

travishathaway commented 12 months ago

Hi @simonrouse9461 ,

Thanks for submitting this feature request. This sounds very reasonable and as @origintopleft mentioned, perhaps we could also expand this feature request to include other shell types too.

The project maintainers cannot promise when we would get around to developing such a feature, but pull requests are always welcome, and we will be happy to review them.

beeankha commented 11 months ago

Create or update $XDG_CONFIG_HOME/fish/conf.d/conda.fish when running conda init fish instead of editing $XDG_CONFIG_HOME/fish/config.fish in place.

@simonrouse9461 does this recently-merged fish shell initialization PR adequately address what you mention above?

simonrouse9461 commented 11 months ago

Hi @beeankha thank you for sharing this related PR. I think this PR doesn't address the same issue as I mentioned. This PR changes the content of the init script, but it doesn't change where conda places the script when calling conda init fish.

beeankha commented 11 months ago

Thanks for the clarification, @simonrouse9461 ! That helps me understand this currently-open issue better.