Skip to content

Comments

fix: prevent file completions in fish shell for git wt#109

Merged
k1LoW merged 1 commit intok1LoW:mainfrom
dgrant:fix-fish-completion-files
Feb 5, 2026
Merged

fix: prevent file completions in fish shell for git wt#109
k1LoW merged 1 commit intok1LoW:mainfrom
dgrant:fix-fish-completion-files

Conversation

@dgrant
Copy link
Contributor

@dgrant dgrant commented Feb 5, 2026

Fixes #108

Fish completion was showing files and directories in the current directory, in addition to worktrees and branches. Added completions for the git-wt command directly to prevent fish's auto-handler from falling back to file completions.

Before:

image

After:

image

🤖 Generated with Claude Code

Fish's auto-handler for custom git commands calls `complete -C "git-wt ..."`
which had no completions registered, causing fish to fall back to file
completions. Added completions for the git-wt command directly with
exclusive mode (-x) to prevent file completions.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copilot AI review requested due to automatic review settings February 5, 2026 09:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #108 where Fish shell completion was incorrectly showing files and directories from the current directory alongside worktrees and branches when using git wt commands. The fix adds proper completion handlers to prevent Fish's default file completion behavior.

Changes:

  • Added new completion function __fish_git_wt_direct_completions for direct git-wt command invocations
  • Changed completion flag from -f (force file completion) to -x (exclusive, no file completion) for git wt
  • Added completion rule for git-wt command to prevent fallback to Fish's automatic file completion

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@k1LoW k1LoW added the bug Something isn't working label Feb 5, 2026
@k1LoW
Copy link
Owner

k1LoW commented Feb 5, 2026

@dgrant GREAT WORK!! Thank you!!

@k1LoW k1LoW merged commit 6315629 into k1LoW:main Feb 5, 2026
8 of 9 checks passed
@github-actions github-actions bot mentioned this pull request Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fish shell completion shows files/directories alongside branches

2 participants