Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh does behave weird if choice contains colon #456

Closed
maurerle opened this issue Nov 12, 2023 · 2 comments
Closed

zsh does behave weird if choice contains colon #456

maurerle opened this issue Nov 12, 2023 · 2 comments

Comments

@maurerle
Copy link

I have a list of choices:

parser.add_argument(
        "-db",
        "--db-uri",
        help="uri string for a database",
        default="",
        type=str,
        choices=[
            "sqlite:///example.db",
            "sqlite:///./examples/local_db/.db",
            "sqlite:///",
            "mysql://username:password@localhost:3306/database",
        ],
    )

I activate my env, run eval "$(register-python-argcomplete myapp)" and the suggestions work fine in bash.
In zsh however, this does not work correctly and only shows suggestions like:
sqlite -- ///example.db:uri string for a database

Is there anything I can do about it? I did not find a way to escape this with some characters.

The problem here seems to be that, zsh suggestion seem to look something like zstyle ':completion:*:*:*:*:descriptions' - where the colon is used to separate the completion from the description..

I have the feeling that this worked yesterday, but I don't know what the cause is

@kislyuk
Copy link
Owner

kislyuk commented Nov 12, 2023

Thank you for reporting. Released fix in v3.1.5, please test.

@maurerle
Copy link
Author

Works well!
Thank you for the quick fix! 🎉

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

No branches or pull requests

2 participants