Skip to content

fix(zsh): show worktree choices on the first Tab - #50

Merged
benbenbang merged 2 commits into
mainfrom
fix/zsh-jump-token
Sep 9, 2026
Merged

benbenbang merged 2 commits into
mainfrom
fix/zsh-jump-token

Conversation

@benbenbang

Copy link
Copy Markdown
Member

cd -jw<Tab> produced no Zsh matches because absolute worktree paths were filtered against the literal -jw prefix. Clear the trigger's matching prefix and suffix, and request menu completion so the first Tab offers full worktree destinations rather than only their common parent.

The fix works with native Zsh completion and fzf-tab. Selecting a destination inserts its path; Enter executes the directory change.

Verified literal Tab in libfmp with the installed fzf-tab plugin, including the fzf-completion widget chained in front, short/long flags, selection, and cancellation. Added a real ZLE regression for accepted matches, quoted path insertion, unchanged working directory, and a cursor inside the jump token. The previous mocked compadd test could not detect the rejection.

Closes #49

Clear PREFIX and SUFFIX and enable menu selection so completion replaces the full jump token instead of inserting a common path prefix.

Add a real ZLE regression test isolated from Git hook repository environment variables.

Fixes #49
@github-actions github-actions Bot added the enhancement New feature or request label Sep 9, 2026
Use non-interactive compinit handling to avoid security prompts on CI runners. Production shell integration remains unchanged.

Refs #49
@benbenbang
benbenbang merged commit 74bc7d1 into main Sep 9, 2026
5 checks passed
@benbenbang
benbenbang deleted the fix/zsh-jump-token branch September 9, 2026 03:02
@ptah-bw-technical-app

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(zsh): offer worktree candidates when Tab replaces a jump token

1 participant