Conversation
tiborvass
reviewed
Jun 25, 2025
| log_info "To enable shell completions, run:" | ||
| echo " Bash (with bash-completion): $binary completion bash > ~/.local/share/bash-completion/completions/cu" | ||
| echo " Bash (unconfigured): echo 'source <($binary completion bash)' >> ~/.bashrc" | ||
| echo " Zsh (with compinit and a writable fpath[1]): $binary completion zsh > \"\${fpath[1]}/_cu\"" |
Contributor
There was a problem hiding this comment.
Docker adds in zshrc, an fpath as the first entry. But i don't want to add cu's completion to my docker's completion folder.
Contributor
Author
There was a problem hiding this comment.
🤔 under some package managers fpath[1] isn't gonna be user-writable either, so unideal in several situations.
can i get a citation for the docker approach?
aluzzardi
reviewed
Jun 25, 2025
aluzzardi
approved these changes
Jun 25, 2025
Signed-off-by: Connor Braa <connor@dagger.io>
52162d8 to
0a40dd6
Compare
Contributor
Author
|
tested homebrew on my fork https://github.com/cwlbraa/homebrew-tap/commits/main/, working correctly and installing cu completions at least for zsh. if you've already got completions in that brew directory, it throws this: but after deleting that file and reinstalling the error goes away. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
requires #130
this PR installs shell completions using homebrew post install hooks and provides instructions on how to install them as install.sh output.
complexities:
eval "$(brew shellenv)"in their zshrc, we can write to$(brew --prefix)/share/zsh/site-functionspretty blindlybecause it's complex to detect what zsh/bash setups a given installer has from inside the installer script, we instead have the install script tell users both the "dumb" rc-centric way to install, and the most common "managed" way.
one alternative approach that folks have talked about is putting this in a
cu initsubcommand or similar. we could do that, but it has all the same difficulties that come with putting this in autoinstalling from our bash-specific install script. there are too many possible shells, userspace package managers, and plugin frameworks and custom configurations (including the absence of them).NOTE: i haven't tested the homebrew tap, don't merge this without testing it on a fork