Skip to content

fix: prevent duplicate empty args in generated completions#132

Merged
AmirSa12 merged 13 commits into
mainfrom
fix/shell-argv
Jun 18, 2026
Merged

fix: prevent duplicate empty args in generated completions#132
AmirSa12 merged 13 commits into
mainfrom
fix/shell-argv

Conversation

@AmirSa12

@AmirSa12 AmirSa12 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Fixes duplicate empty argv handling in generated shell completions
  • Adds shell-level regression tests for zsh, bash, fish, and PowerShell
  • Verifies these cases:
    • demo <TAB> -> [""]
    • demo d<TAB> -> ["d"]
    • demo dev <TAB> -> ["dev", ""]

Why

zsh and powershell completion scripts append an extra synthetic empty argument even when the current empty word was already present. This caused root empty completion to call the backend with ["", ""] instead of [""].

Testing

  • pnpm test tests/shell-empty-argv.test.ts

@changeset-bot

changeset-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 932a8d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bomb.sh/tab Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@bomb.sh/tab@132

commit: 932a8d3

@AmirSa12 AmirSa12 changed the title tests fix: prevent duplicate empty args in generated completions Jun 18, 2026
@AmirSa12 AmirSa12 marked this pull request as ready for review June 18, 2026 15:25
@AmirSa12 AmirSa12 merged commit 998ab6f into main Jun 18, 2026
12 checks passed
@AmirSa12 AmirSa12 deleted the fix/shell-argv branch June 18, 2026 16:11
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