Skip to content

Bash completion does not support bash versions older than 4.4 #2152

@sirosen

Description

@sirosen

I maintain a CLI tool built on click and just had a user report issues with completion on bash 4.2 on a CentOS box.

It seems that nosort was added as an option in bash 4.4. There's even a comment in the completer source about this.
I think it would make sense for the completer to check for BASH_VERSION showing a value below 4.4 and not use nosort in that case. If BASH_VERSION is not set, it's probably safe to assume that nosort is permissible -- I'd rather not degrade environments with a modern bash version but which (for whatever reason) are not showing that env var.

I'm okay with click closing this as a wontfix (old version, not supported), but I want to document the issue and discuss the workaround. If I were to work out the necessary code for this, would there be an appetite for reviewing and merging it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions