<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - shell-completion: pacat device completion doesn't work properly with Bash"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=68106">68106</a>
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lennart@poettering.net
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>shell-completion: pacat device completion doesn't work properly with Bash
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tanuk@iki.fi
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>PulseAudio
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The Bash shell completion for pacat --device somehow combines the names of
sinks and their monitor sources, resulting in mess like the following:

<span class="quote">> pacat --device=alsa_<TAB></span >
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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>