Repository navigation
worktrunk: eval dynamic completions registration - #497
Merged
Merged
Conversation
worktrunk 0.60.0 ships the upstream fix from worktrunk/worktrunk#3105: `wt config shell completions zsh` now emits a dynamic registration (the clap_complete::env path) that completes branch and worktree names, plus the recency-ordering zstyles, instead of a static subcommands-and-flags completer. That removes the reason for #493's workaround, which bound init.zsh's _wt_lazy_complete by hand after compinit. Revert to the documented one-liner; the eval now runs after compinit (deferred completion hook), so its compdef binding takes effect.
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.
Reverts the workaround from #493.
completion.zshgoes back to the documentedeval "$(wt config shell completions zsh)".#493 existed because, on an installed binary,
wt config shell completions zshemitted a static completer (subcommands and flags only), sowt switch <TAB>never offered branch or worktree names. The workaround instead boundinit.zsh's_wt_lazy_completeby hand after compinit.worktrunk 0.60.0 ships the upstream fix (worktrunk/worktrunk#3105):
wt config shell completions zshnow emits a dynamic registration (the maintainedclap_complete::envpath) that calls the binary at completion time, completing branch and worktree names and carrying the recency-ordering zstyles. So the one-liner is sufficient again. It runs in the deferred completion hook, after compinit, so itscompdefbinding takes effect.Verified on 0.60.0: sourcing
completion.zshunder compinit binds_clap_dynamic_completer_wtforwt, and the completer emits the repo's branch and worktree names with recency descriptions.