Skip to content

fix: Zsh completion fails when global options precede a subcommand #2377

Description

@agarwal-ishaan

pdd’s Zsh completion dispatcher assumes the subcommand is always the second shell token. As a result, global options placed before the command break command-specific completion:

pdd --local sync <Tab>

The dispatcher reads --local as though it were the subcommand, so it falls back to generic completion instead of invoking _pdd_sync. Normal completion such as pdd sync <Tab> continues to work.

Expected behavior: Zsh completion should find the first known PDD subcommand after skipping global flags and values for global options that take arguments. Both forms should provide sync-specific suggestions:

pdd sync <Tab>
pdd --local sync <Tab>

The fix updates prompts/pdd_completion_zsh.prompt, regenerates/updates pdd/pdd_completion.zsh, and adds regression coverage for --local and --context local before sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions