Skip to content

Completion for options with comma-separated values loses its prefix #240

@Lekensteyn

Description

@Lekensteyn

commit 021058b tried to extend completion such that usermod -G root,systemd-<TAB> suggests possible completions for systemd-.

It works when only a single candidate is available (e.g. root,systemd-core<TAB> -> root,systemd-coredump), but when multiple completions are available, the prefix (root,) is dropped (e.g. root,systemd-<TAB> -> systemd- with initially no further suggestions).

This problem was first noticed when using the tshark -O http,t<TAB> option.

Reproducer (change XDG_DATA_DIRS to avoid loading completions from default path):

$ bash --rcfile <(echo 'XDG_DATA_DIRS=/nonexistent; . ./bash_completion')
$ usermod -G root,systemd-<TAB>

Environment:

  • Distribution: Arch Linux
  • bash 4.4.023-1
  • bash-completion 2.8-1 and git master 2.1-871-gc9c14da4

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