title: How to list tabs within a screen session from command line while detatched
body: <p>I am trying to figure out a way to list all of the tabs in a specific screen session from command line.  Specifically, I just want to figure out if a tab exists of some particular name.</p>
  
  <p>I have a script which creates a new tab in a session and runs a script there for a list of tab names.  For some reason, there are occasionally one or two tabs that don't get created and this throws off the top level script.  I want to add an acknowledgement in my top level script that checks if the particular tab was created and, if not, have a log that tells me this when I go back and look at the data.</p>
  
  <p>Here is my top level code snippet, in case you may have any pointers on why a particular tab would not get created.  My guess is that the tabs get created too quickly and this potentially causes an error.  There are definitely no name conflicts</p>
  
  <pre><code>for f in $PWD/*; do
    if [ -d $f ]; then
      CMD="cd $f; bash cmd"
  
      # Creates a new screen window with title '$f' in existing screen session
      screen -S $SESSION_NAME -X screen -t $f
  
      # Switch terminal to bash
      screen -S $SESSION_NAME -p $f -X stuff "bash$(printf \\r)"
  
      # Launch $CMD in newly created screen window
      screen -S $SESSION_NAME -p $f -X stuff "$CMD$(printf \\r)"
  
    fi
  done
  </code></pre>
  
  <p>Thanks for the help!</p>