Skip to content

Insufficient escaping \ in zsh's _python_argcomplete #539

@msva

Description

@msva

Hi there!
I'm using pipx's and it, in turn, uses argcomplete for it's completions.

Every time I use pipx's completion, I'm getting following error:

_python_argcomplete:17: failed to compile regexp /([^\]):/: missing terminating ] for character class

As far as I see inn exported function, there is following line (although, it is 19 and not 17)

if [[ "${completions-}" =~ ([^\\]): && "${match[1]}" =~ [=/:] ]]

I think, it is ([^\\]) block's fault. Looks like first level of escaping happens, but then it interpret's one more time and that time slash escapes the ].
So, I think it is not enough to escape it just one time, and it needs more levels of escaping, or even changing the statement at all 🤷

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions