title: What are the correct beginsPattern and endsPattern for a background Task in VSCode?
body: <p>I have a static website (i.e. just html and client side JavaScript) that I serve with python while debugging locally. I have a VSCode task that will start python correctly and am trying to set that task as the <code>preLaunchTask</code> on a <a href="https://github.com/Microsoft/vscode-chrome-debug" rel="nofollow noreferrer">Debugger for Chrome</a> launch task. The desired behavior is that whenever I start debugging the <code>serve</code> task below ensures the site is being served.</p>
  
  <p>If I understand background tasks correctly one can set a <code>beginsPattern</code> and <code>endsPattern</code> to signal state changes. </p>
  
  <p>I am expecting that when python echos </p>
  
  <blockquote>
    <p>Serving HTTP on 0.0.0.0 port 8000 (<a href="http://0.0.0.0:8000/" rel="nofollow noreferrer">http://0.0.0.0:8000/</a>) ...</p>
  </blockquote>
  
  <p>to <code>stdout</code> that the <code>problemMatcher</code> below would signal to the launch task that it had started. Instead, the launch task waits forever, and doesn't proceed until the task's shell command is terminated.</p>
  
  <p>Can tasks be configured to achieve this sort of behavior?</p>
  
  <p><strong>Launch Configuration</strong></p>
  
  <pre><code>{
      "version": "0.2.0",
      "configurations": [
          {
              "type": "chrome",
              "request": "launch",
              "name": "Launch Chrome against localhost",
              "url": "http://localhost:8000",
              "webRoot": "${workspaceFolder}/webroot",
              "preLaunchTask": "serve"
          }
      ]
  }
  </code></pre>
  
  <p><strong>Serve Task</strong></p>
  
  <pre><code>{
      "version": "2.0.0",
      "tasks": [
          {
              "label": "serve",
              "type": "shell",
              "command": "python3 -m http.server",
              "windows": {
                  "command": "py -m http.server"
              },
              "isBackground": true,
              "options": {
                  "cwd": "${workspaceFolder}/webroot"
              },
              "presentation": {
                  "echo": true,
                  "reveal": "always",
                  "focus": false,
                  "panel": "dedicated"
              },
              "problemMatcher": {
                  "owner": "custom",
                  "pattern":[
                      {
                          "regexp": "^([^\\s].*)$",
                          "file": 1,
                          "location": 2,
                          "message": 3
                      }
                  ],
                  "background": {
                      "activeOnStart": true,
                      "beginsPattern":"^Serving HTTP (.*)$",
                      "endsPattern":"^Keyboard interrupt received, exiting(.*)$"
                  }
              }            
          }
      ]
  }
  </code></pre>