Skip to content

incorrect ~/.bash_completion  #6384

Description

@xkxixnxgx
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: 5.18.0-kali5-amd64 (debian)

  • Poetry version: Poetry (version 1.2.0)

  • Link with the contents of your pyproject.toml file:

Issue

After installing Poetry, I executed the command according to the documentation to add tab completion .
https://python-poetry.org/docs/#auto-loaded-recommended

poetry completions bash >> ~/.bash_completion

When opening a new bash shell, an error message appears in ~/.bash_completion

bash: /home/user/.bash_completion: line 40: syntax error next to unexpected "clear" marker
bash: /home/user/.bash_completion: line 40: `            (cache clear)'

And so on all lines where the value in the lines consists of two words.

->        (debug info)
            opts="${opts} "
            ;;

->        (debug resolve)
            opts="${opts} --extras --install --python --tree"
            ;;

I wrapped such variables in quotes and the problem went away.

            ("debug info")
            opts="${opts} "
            ;;

            ("debug resolve")
            opts="${opts} --extras --install --python --tree"
            ;;

Tab completion works, but only for the first word.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/duplicateDuplicate issues

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions