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

cli: fix cli completion setup for zsh #21101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dvdksn
Copy link
Contributor

@dvdksn dvdksn commented Oct 10, 2024

Autocomplete was not set up correctly when tilde was used in FPATH.

Changed the .zshrc config to use $HOME instead (and quoting the heredoc delimiter to escape env vars)

@dvdksn dvdksn requested a review from Benehiko October 10, 2024 13:06
Copy link

netlify bot commented Oct 10, 2024

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 669b007
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/6707d15e402c380008a5d501
😎 Deploy Preview https://deploy-preview-21101--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the area/engine Issue affects Docker engine/daemon label Oct 10, 2024
@dvdksn dvdksn added the area/cli Relates to the CLI client label Oct 10, 2024
@dvdksn dvdksn requested a review from a team October 10, 2024 13:26
@thaJeztah
Copy link
Member

Wondering if we can use the instruction from the completions command itself;

docker completion zsh --help

Usage:  docker completion zsh

Generate the autocompletion script for the zsh shell.

If shell completion is not already enabled in your environment you will need
to enable it.  You can execute the following once:

	echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions in your current shell session:

	source <(docker completion zsh)

To load completions for every new session, execute once:

#### Linux:

	docker completion zsh > "${fpath[1]}/_docker"

#### macOS:

	docker completion zsh > $(brew --prefix)/share/zsh/site-functions/_docker

You will need to start a new shell for this setup to take effect.

@dvdksn
Copy link
Contributor Author

dvdksn commented Oct 10, 2024

docker completion zsh > "${fpath[1]}/_docker"

I don't particularly love this. Maybe because I am not a zsh user, but I think the version in these docs are clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Relates to the CLI client area/engine Issue affects Docker engine/daemon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tilde used in zsh completion leads to misconfiguration
3 participants