wt switch <tab> doesn't work
I'm attempting to use tab completion to finish a branch name for wt switch, but it's showing me a list of seemingly unrelated branches instead.
I do have 20 branches checked out, but only 16 of them on worktrees (don't judge, I'm initially attempting to use worktrunk to clean up many old worktrees I never found a good workflow for removing 😁 ), but it wants to suggest 80 different branches that don't even start with the bit I've typed in thus far (and only after hitting tab twice and confirming I want to see all 80).
I'm using Git Bash shell on Windows, but the FAQ says tab completion is supported in this environment. To be honest, I guess I'm not sure if this is supposed to work, but our team uses pretty descriptive branch names, so this tool is really not helpful to me if tab completion in this usage doesn't work.
Thanks for any help folks can give me here.
Thanks for reporting this! I was able to reproduce the issue and identified the root cause: bash's programmable completion (complete -F) does not filter COMPREPLY by prefix — whatever the completion function returns is displayed as-is. The binary was returning all branch candidates for every shell, expecting each shell to do its own filtering. This works for fish (substring matching) and zsh (fuzzy matching), but means bash users see every branch regardless of what they've typed.
I've opened #1622 with a fix that filters completions by prefix when the requesting shell is bash, while preserving the full candidate list for fish/zsh. A maintainer will review it shortly.