Skip to content

worktrunk: eval dynamic completions registration - #497

Merged
bendrucker merged 1 commit into
mainfrom
worktrunk-dynamic-completer
Jun 19, 2026
Merged

bendrucker merged 1 commit into
mainfrom
worktrunk-dynamic-completer

Conversation

@bendrucker

Copy link
Copy Markdown
Owner

Reverts the workaround from #493. completion.zsh goes back to the documented eval "$(wt config shell completions zsh)".

#493 existed because, on an installed binary, wt config shell completions zsh emitted a static completer (subcommands and flags only), so wt switch <TAB> never offered branch or worktree names. The workaround instead bound init.zsh's _wt_lazy_complete by hand after compinit.

worktrunk 0.60.0 ships the upstream fix (worktrunk/worktrunk#3105): wt config shell completions zsh now emits a dynamic registration (the maintained clap_complete::env path) 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 its compdef binding takes effect.

Verified on 0.60.0: sourcing completion.zsh under compinit binds _clap_dynamic_completer_wt for wt, and the completer emits the repo's branch and worktree names with recency descriptions.

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.
@bendrucker
bendrucker merged commit e00147a into main Jun 19, 2026
5 of 6 checks passed
@bendrucker
bendrucker deleted the worktrunk-dynamic-completer branch June 19, 2026 05:17
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

Successfully merging this pull request may close these issues.

1 participant