Bug 68106 - shell-completion: pacat device completion doesn't work properly with Bash
Summary: shell-completion: pacat device completion doesn't work properly with Bash
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: tools (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 13:44 UTC by Tanu Kaskinen
Modified: 2013-08-15 07:09 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

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.