Bug 68106

Summary: shell-completion: pacat device completion doesn't work properly with Bash
Product: PulseAudio Reporter: Tanu Kaskinen <tanuk>
Component: toolsAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart, poljar
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Tanu Kaskinen 2013-08-14 13:44:07 UTC
The Bash shell completion for pacat --device somehow combines the names of sinks and their monitor sources, resulting in mess like the following:

> pacat --device=alsa_<TAB>
alsa_input.pci-0000_00_1b.0.analog-stereo
alsa_output.pci-0000_00_1b.0.analog-stereoalsa_output.pci-0000_00_1b.0.analog-stereo.monitor

Note the concatenated string containing a sink name and the sink's monitor source name. Here's a snippet from _pacat():

_pacat () {
    ...
    case $cur in
        ...
        --device=*)
            cur=${cur#*=}
            comps=$(__sinks)
            comps+=$(__sources)
            COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
            ;;

The bug is probably in the _pacat() function, because the __sinks() and __sources() functions seem good. I suspect the COMPREPLY line is incorrect, but I don't know in what way.
Comment 1 poljar 2013-08-14 14:10:17 UTC
Patch sent to mailing list[1].

[1] http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-August/018338.html

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.