title: How to tab complete screen -r in Ubuntu?
body: <p>I want to tab complete the command <code>screen -r</code> in Ubuntu so that I can recover previous screens more easily. I know the <code>screen -x</code> command, however I still need <code>screen -r</code> in the situation where more than one screens exist.</p>
  
  <p>I find that this tab completion feature does not exist in every Ubuntu machine. Sometimes, in the same machine, the tab completion works for bash shell but fails for zsh shell.</p>
  
  <p>Can anyone tell me how to configure this tab completion feature for bash and zsh in Ubuntu?</p>
  
  <p>===============================Some Facts================================</p>
  
  <p>Here are some useful facts I found after asking this question. I think these facts can serve as workarounds to some extent. </p>
  
  <p>I find that, even if I don't have tab completion support, I can also use part of the screen name to recover my screen. For example, given a screen <code>12354.pts-0.slave9</code>, I can recover it by simply typing <code>screen -r 1</code> if no other screen name starts with 1.</p>
  
  <p>As for zsh, if it can not tab complete <code>screen -r 1</code>, it can possibly tab complete <code>screen -r 0</code>. Here <code>0</code> comes from the substring <code>pts-0</code>, which means you can use other parts of the name for tab completion. </p>