[codex] Fix Docker completion cache refresh - #40
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1bf1b40c9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Cached compinit - only regenerate once per day | ||
| autoload -Uz compinit | ||
| if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then | ||
| if [[ "$_compinit_rebuild" == true || -n ~/.zcompdump(#qN.mh+24) ]]; then |
There was a problem hiding this comment.
Force the dump refresh when Docker is absent
When _compinit_rebuild is true, this still invokes plain compinit, which can source the existing ~/.zcompdump whenever the dump header's completion-file count and ZSH_VERSION match the current fpath. In the stale-cache case where Docker was added but the total count stayed the same, the grep check remains true yet compinit reloads the stale dump, so _docker remains unavailable and each new shell keeps doing the slower uncached check; remove/rename the dump or otherwise force regeneration before initializing.
Useful? React with 👍 / 👎.
This updates .zshrc so ~/.docker/completions triggers a non-cached compinit when the existing ~/.zcompdump lacks Docker completion metadata.
Without this, compinit -C can keep using a dump created before Docker was on fpath, so _docker remains unavailable until the dump ages out or is deleted.
Validated with make zsh-check.