Skip to content

cmd.Cmd completion fails in some cases, must allow the definition of readline completion delimiters #120479

@diegorubert

Description

@diegorubert

Bug report

Bug description:

cmd.Cmd does not allow the definition of readline completion delimiters, therefore, complete_*() methods will fail with completion options containing dashes (or other characters in readline's default list of delimiters).

Defining a Cmd.completer_delims (by default None) and then calling readline.set_completer_delims(self.completer_delims) (if Cmd.completer_delims is not None) after importing readline will do the trick.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions