Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should bash completion be auto-activated ? #67

Open
phil-blain opened this issue Oct 18, 2019 · 2 comments
Open

Should bash completion be auto-activated ? #67

phil-blain opened this issue Oct 18, 2019 · 2 comments

Comments

@phil-blain
Copy link
Contributor

I see in

# Install completion files
mkdir -p $PREFIX/share/bash-completion/completions
cp contrib/completion/git-completion.bash $PREFIX/share/bash-completion/completions/git

that the bash-completion script in installed to $CONDA_PREFIX/share/bash-completion/completions/git.

Should this script also be added to ${PREFIX}/etc/conda/activate.d/ so that it is automatically sourced when the environment is activated ?
I think that would be a great addition and I'd be happy to submit a PR for that.

Reference: https://docs.conda.io/projects/conda-build/en/latest/resources/activate-scripts.html

@jakirkham
Copy link
Member

Agree this would be great.

That said, let's think through this a bit. Would it interfere with already active bash completion? Would this only gets run in the bash shell or would it run in other shells? If the latter, how can we protect against sourcing this in the wrong shell?

Thoughts from others?

cc @conda-forge/git

@asmeurer
Copy link
Member

Isn't that a general problem for activate scripts. Presumably there is a way to only source for the right shell.

git has completion for bash, zsh, and tsch.

As for if it's already enabled, it looks like it should work to check if __git_complete is already defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants