Repository: vscode
Issue: Task beginsPattern does not work
Labels: bug,tasks

This is my task config (it is from the github.com/microsoft/monaco-editor):
```
{
    "label": "Launch Http Server",
    "type": "shell",
    "command": "node_modules/.bin/http-server --cors --port 5002 -a 127.0.0.1 -c-1",
    "isBackground": true,
    "problemMatcher": {
        "pattern": {
            "regexp": ""
        },
        "background": {
            "beginsPattern": "Starting up http-server",
            "endsPattern": "Shutting down server"
        }
    },
    "dependsOn": ["npm: watch"]
},
```

However, the task does not complete:
![image](https://user-images.githubusercontent.com/2931520/220592720-4a8cd162-9d84-46f5-9a7b-30b4dd9b5fd1.png)


This is logged escape sequence, it clearly contains the begin pattern:
```
LogService.ts:60 xterm.js: Unbinding from mouse events.
LogService.ts:60 xterm.js: parsing data "]633;A]633;P;Task=True]633;P;Cwd=c:\dev\microsoft\monaco-editor]633;B *  Executing task: node_modules/.bin/http-server --cors --port 5002 -a 127.0.0.1 -c-1 

]633;C" (190) [27, 93, 54, 51, 51, 59, 65, 7, 27, 93, 54, 51, 51, 59, 80, 59, 84, 97, 115, 107, 61, 84, 114, 117, 101, 7, 27, 93, 54, 51, 51, 59, 80, 59, 67, 119, 100, 61, 99, 58, 92, 100, 101, 118, 92, 109, 105, 99, 114, 111, 115, 111, 102, 116, 92, 109, 111, 110, 97, 99, 111, 45, 101, 100, 105, 116, 111, 114, 7, 27, 93, 54, 51, 51, 59, 66, 7, 27, 91, 48, 109, 27, 91, 55, 109, 32, 42, 32, 27, 91, 48, 109, 32, 69, 120, 101, 99, 117, 116, 105, …]
LogService.ts:60 xterm.js: parsing data "
" (2) [13, 10]
LogService.ts:60 xterm.js: parsing data "[?25l[H[10:55:09] Starting compilation in watch mode...[K
[K
[10:55:27] Found 0 errors. Watching for file changes.[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[5;1H[?25h" (311) [27, 91, 63, 50, 53, 108, 27, 91, 72, 91, 27, 91, 57, 48, 109, 49, 48, 58, 53, 53, 58, 48, 57, 27, 91, 109, 93, 32, 83, 116, 97, 114, 116, 105, 110, 103, 32, 99, 111, 109, 112, 105, 108, 97, 116, 105, 111, 110, 32, 105, 110, 32, 119, 97, 116, 99, 104, 32, 109, 111, 100, 101, 46, 46, 46, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 91, 27, 91, 57, 48, 109, 49, 48, 58, 53, 53, 58, 50, 55, 27, 91, 109, 93, 32, 70, 111, 117, 110, 100, 32, …]
LogService.ts:60 xterm.js: parsing data "[6n" (4) [27, 91, 54, 110]
LogService.ts:60 xterm.js: sending data "[3;1R" (6) [27, 91, 51, 59, 49, 82]
LogService.ts:60 xterm.js: parsing data "[?25l[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[3;1H]0;C:\Program Files\PowerShell\7-preview\pwsh.exe[?25h" (235) [27, 91, 63, 50, 53, 108, 27, 91, 109, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, …]
LogService.ts:60 xterm.js: parsing data "]633;P;IsWindows=True" (23) [27, 93, 54, 51, 51, 59, 80, 59, 73, 115, 87, 105, 110, 100, 111, 119, 115, 61, 84, 114, 117, 101, 7]
LogService.ts:60 xterm.js: parsing data "]0;http-server" (16) [27, 93, 48, 59, 104, 116, 116, 112, 45, 115, 101, 114, 118, 101, 114, 7]
LogService.ts:60 xterm.js: parsing data "[?25lStarting up http-server, serving ./[5;1Hhttp-server version: 14.1.1[7;1Hhttp-server settings: 
CORS: true
Cache: -1 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none[17;1HAvailable on:
  http://127.0.0.1:5002
Hit CTRL-C to stop the server[21;1H[?25h" (502) [27, 91, 63, 50, 53, 108, 27, 91, 51, 51, 109, 83, 116, 97, 114, 116, 105, 110, 103, 32, 117, 112, 32, 104, 116, 116, 112, 45, 115, 101, 114, 118, 101, 114, 44, 32, 115, 101, 114, 118, 105, 110, 103, 32, 27, 91, 51, 54, 109, 46, 47, 27, 91, 51, 51, 109, 27, 91, 53, 59, 49, 72, 104, 116, 116, 112, 45, 115, 101, 114, 118, 101, 114, 32, 118, 101, 114, 115, 105, 111, 110, 58, 32, 27, 91, 51, 54, 109, 49, 52, 46, 49, 46, 49, 27, 91, 51, 51, 109, 27, …]
LogService.ts:60 xterm.js: parsing data "[?25l[HPS C:\dev\microsoft\monaco-editor>[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[2;1H[?25h" (238) [27, 91, 63, 50, 53, 108, 27, 91, 72, 80, 83, 32, 67, 58, 92, 100, 101, 118, 92, 109, 105, 99, 114, 111, 115, 111, 102, 116, 92, 109, 111, 110, 97, 99, 111, 45, 101, 100, 105, 116, 111, 114, 62, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, …]
LogService.ts:60 xterm.js: parsing data "[?25l[H[10:55:09] Starting compilation in watch mode...[K
[K
[10:55:27] Found 0 errors. Watching for file changes.[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[5;1H[?25h" (311) [27, 91, 63, 50, 53, 108, 27, 91, 72, 91, 27, 91, 57, 48, 109, 49, 48, 58, 53, 53, 58, 48, 57, 27, 91, 109, 93, 32, 83, 116, 97, 114, 116, 105, 110, 103, 32, 99, 111, 109, 112, 105, 108, 97, 116, 105, 111, 110, 32, 105, 110, 32, 119, 97, 116, 99, 104, 32, 109, 111, 100, 101, 46, 46, 46, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 91, 27, 91, 57, 48, 109, 49, 48, 58, 53, 53, 58, 50, 55, 27, 91, 109, 93, 32, 70, 111, 117, 110, 100, 32, …]
LogService.ts:60 xterm.js: parsing data "[?25l[3;1HStarting up http-server, serving ./[K
[K
http-server version: 14.1.1[K
[K
http-server settings:[K
CORS: true[K
Cache: -1 seconds[K
Connection Timeout: 120 seconds[K
Directory Listings: visible[K
AutoIndex: visible[K
Serve GZIP Files: false[K
Serve Brotli Files: false[K
Default File Extension: none[K
[K
Available on:[K
  http://127.0.0.1:5002[K
Hit CTRL-C to stop the server[K
[K
>[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[21;3H[?25h" (641) [27, 91, 63, 50, 53, 108, 27, 91, 51, 51, 109, 27, 91, 51, 59, 49, 72, 83, 116, 97, 114, 116, 105, 110, 103, 32, 117, 112, 32, 104, 116, 116, 112, 45, 115, 101, 114, 118, 101, 114, 44, 32, 115, 101, 114, 118, 105, 110, 103, 32, 27, 91, 51, 54, 109, 46, 47, 27, 91, 75, 27, 91, 109, 13, 10, 27, 91, 75, 27, 91, 51, 51, 109, 13, 10, 104, 116, 116, 112, 45, 115, 101, 114, 118, 101, 114, 32, 118, 101, 114, 115, 105, 111, 110, 58, 32, 27, 91, 51, 54, …]
LogService.ts:60 xterm.js: parsing data "[?25l[H[10:55:09] Starting compilation in watch mode...[K
[K
[10:55:27] Found 0 errors. Watching for file changes.[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[5;1H[?25h" (306) [27, 91, 63, 50, 53, 108, 27, 91, 72, 91, 27, 91, 57, 48, 109, 49, 48, 58, 53, 53, 58, 48, 57, 27, 91, 109, 93, 32, 83, 116, 97, 114, 116, 105, 110, 103, 32, 99, 111, 109, 112, 105, 108, 97, 116, 105, 111, 110, 32, 105, 110, 32, 119, 97, 116, 99, 104, 32, 109, 111, 100, 101, 46, 46, 46, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 91, 27, 91, 57, 48, 109, 49, 48, 58, 53, 53, 58, 50, 55, 27, 91, 109, 93, 32, 70, 111, 117, 110, 100, 32, …]
LogService.ts:60 xterm.js: parsing data "[?25l[HPS C:\dev\microsoft\monaco-editor>[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[2;1H[?25h" (238) [27, 91, 63, 50, 53, 108, 27, 91, 72, 80, 83, 32, 67, 58, 92, 100, 101, 118, 92, 109, 105, 99, 114, 111, 115, 111, 102, 116, 92, 109, 111, 110, 97, 99, 111, 45, 101, 100, 105, 116, 111, 114, 62, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, …]
LogService.ts:60 xterm.js: parsing data "[?25l[3;1HStarting up http-server, serving ./[K
[K
http-server version: 14.1.1[K
[K
http-server settings:[K
CORS: true[K
Cache: -1 seconds[K
Connection Timeout: 120 seconds[K
Directory Listings: visible[K
AutoIndex: visible[K
Serve GZIP Files: false[K
Serve Brotli Files: false[K
Default File Extension: none[K
[K
Available on:[K
  http://127.0.0.1:5002[K
Hit CTRL-C to stop the server[K
[K
>[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[21;3H[?25h" (636) [27, 91, 63, 50, 53, 108, 27, 91, 51, 51, 109, 27, 91, 51, 59, 49, 72, 83, 116, 97, 114, 116, 105, 110, 103, 32, 117, 112, 32, 104, 116, 116, 112, 45, 115, 101, 114, 118, 101, 114, 44, 32, 115, 101, 114, 118, 105, 110, 103, 32, 27, 91, 51, 54, 109, 46, 47, 27, 91, 75, 27, 91, 109, 13, 10, 27, 91, 75, 27, 91, 51, 51, 109, 13, 10, 104, 116, 116, 112, 45, 115, 101, 114, 118, 101, 114, 32, 118, 101, 114, 115, 105, 111, 110, 58, 32, 27, 91, 51, 54, …]
LogService.ts:60 xterm.js: parsing data "[?25l[H[10:55:09] Starting compilation in watch mode...[K
[K
[10:55:27] Found 0 errors. Watching for file changes.[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[5;1H[?25h" (306) [27, 91, 63, 50, 53, 108, 27, 91, 72, 91, 27, 91, 57, 48, 109, 49, 48, 58, 53, 53, 58, 48, 57, 27, 91, 109, 93, 32, 83, 116, 97, 114, 116, 105, 110, 103, 32, 99, 111, 109, 112, 105, 108, 97, 116, 105, 111, 110, 32, 105, 110, 32, 119, 97, 116, 99, 104, 32, 109, 111, 100, 101, 46, 46, 46, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 91, 27, 91, 57, 48, 109, 49, 48, 58, 53, 53, 58, 50, 55, 27, 91, 109, 93, 32, 70, 111, 117, 110, 100, 32, …]
LogService.ts:60 xterm.js: parsing data "[?25l[HPS C:\dev\microsoft\monaco-editor>[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[2;1H[?25h" (238) [27, 91, 63, 50, 53, 108, 27, 91, 72, 80, 83, 32, 67, 58, 92, 100, 101, 118, 92, 109, 105, 99, 114, 111, 115, 111, 102, 116, 92, 109, 111, 110, 97, 99, 111, 45, 101, 100, 105, 116, 111, 114, 62, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, 75, 13, 10, 27, 91, …]
LogService.ts:60 xterm.js: parsing data "[?25l[3;1HStarting up http-server, serving ./[K
[K
http-server version: 14.1.1[K
[K
http-server settings:[K
CORS: true[K
Cache: -1 seconds[K
Connection Timeout: 120 seconds[K
Directory Listings: visible[K
AutoIndex: visible[K
Serve GZIP Files: false[K
Serve Brotli Files: false[K
Default File Extension: none[K
[K
Available on:[K
  http://127.0.0.1:5002[K
Hit CTRL-C to stop the server[K
[K
>[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K
[K[21;3H[?25h" (651) [27, 91, 63, 50, 53, 108, 27, 91, 51, 51, 109, 27, 91, 51, 59, 49, 72, 83, 116, 97, 114, 116, 105, 110, 103, 32, 117, 112, 32, 104, 116, 116, 112, 45, 115, 101, 114, 118, 101, 114, 44, 32, 115, 101, 114, 118, 105, 110, 103, 32, 27, 91, 51, 54, 109, 46, 47, 27, 91, 75, 27, 91, 109, 13, 10, 27, 91, 75, 27, 91, 51, 51, 109, 13, 10, 104, 116, 116, 112, 45, 115, 101, 114, 118, 101, 114, 32, 118, 101, 114, 115, 105, 111, 110, 58, 32, 27, 91, 51, 54, …]

```