title: Customize tab completion in shell
body: <p>This may be have a better name than "custom tab completion", but here's the scenario:</p>
  
  <p>Typically when I'm at the command line and I enter a command, followed with {TAB} twice, I get a list of all files and subdirectories in the current directory.  For example:</p>
  
  <pre><code>[user@host tmp]$ cat &lt;TAB&gt;&lt;TAB&gt;
  chromatron2.exe                  Fedora-16-i686-Live-Desktop.iso  isolate.py
  favicon.ico                      foo.exe                          James_Gosling_Interview.mp3
  </code></pre>
  
  <p>However, I noticed at least one program somehow filters this list: <code>wine</code>.  Consider:</p>
  
  <pre><code>[user@host tmp]$ wine &lt;TAB&gt;&lt;TAB&gt;
  chromatron2.exe  foo.exe
  </code></pre>
  
  <p>It effectively filters the results to <code>*.exe</code>.</p>
  
  <p>Thinking it might be some sort of wrapper script responsible for the filtering, a did a <code>which</code> and <code>file</code> an it turns out <code>wine</code> is not a script but an executable.</p>
  
  <p>Now, I don't know whether this "filter" is somehow encoded in the program itself, or otherwise specified during the default wine install, so I'm not sure whether this question is more appropriate for stackoverflow or superuser, so I'm crossing my fingers and throwing it here.  I apologize if I guessed wrong.  (Also, I checked a few similar questions, but most were irrelevant or involved editing the shell configuration.)</p>
  
  <p>So my question is, how is this "filtering" accomplished?  Thanks in advance.</p>