Skip to content

fix: keep the shell directive set by an option or argument handler - #158

Open
MgmClientGuy0 wants to merge 1 commit into
bombshell-dev:mainfrom
MgmClientGuy0:fix/handler-directive
Open

MgmClientGuy0 wants to merge 1 commit into
bombshell-dev:mainfrom
MgmClientGuy0:fix/handler-directive

Conversation

@MgmClientGuy0

Copy link
Copy Markdown

What does this PR do?

complete() currently resets the shell directive to the hardcoded ShellCompDirectiveNoFileComp after the option handlers had run. Any user that wants to support file or directory completions could not change this.

#97 already proposed falling back to file completion automatically and was closed in favour of letting the user choose. This PR should allow a user to do that. This should be non-breaking. Any existing code still defaults to ShellCompDirectiveNoFileComp.

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • All tests pass (pnpm test)
  • Files are formatted (pnpm format)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code
  • Code was generated with Claude Opus 5.5. I have reviewed and understood every line. PRs and potential comments are written by human.

`complete()` reset `directive` to `ShellCompDirectiveNoFileComp` after the
handlers had run, so a handler could not choose file or directory
completion. Reset it at the start of `parse()` instead: the default stays
`:4`, and a handler can set e.g. `ShellCompDirectiveDefault` or
`ShellCompDirectiveFilterDirs` for its completion request.
@changeset-bot

changeset-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7f7fc32

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

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