Skip to content

[BUG] Auto-completion not work in pwsh #266

@dysuby

Description

@dysuby

Describe the bug

I try to install auto completion by running python main.py --install-completion pwsh and it executes successfully. But I only get path hint but not command hint.

To Reproduce

  • Create a file main.py with:
import typer


def complete_name():
    return ["Camila", "Carlos", "Sebastian"]


def main(
    name: str = typer.Option(
        "World", help="The name to say hi to.", autocompletion=complete_name
    )
):
    typer.echo(f"Hello {name}")


if __name__ == "__main__":
    typer.run(main)
  • Run python main.py --install-completion pwsh

Expected behavior

just help me complete commands

Screenshots

image

Environment

  • OS: Windows10
  • Typer Version: 0.3.2
  • python version: 3.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions