"Skip Active Task"?

Step 1: Run (F5) simple while-true-print-hello-world Java application using a task and connect to the debugger.
Step 2: Stop the debugger (the task is still active, printing hello-world.
Step 3: F5 -> notification: “the task * is already active - terminate / restart task”.

We wish to connect the debugger to the opened port although the task is still active.
Is there such a way without terminating / restarting the task?

Thank you!!!
Here are the related files:

launch.json:
{
“version”: “0.2.0”,
“configurations”: [
{
“type”: “java”,
“name”: “Hello”,
“request”: “attach”,
“hostName”: “127.0.0.1”,
“port”: 8999,
“projectName”: “Hello”,
“preLaunchTask”: “run-Hello”
}
]
}

tasks.json:
{
“version”: “2.0.0”,
“tasks”: [
{
“label”: “run-Hello”,
“type”: “shell”,
“command”: “java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8999 Hello”,
“isBackground”: true,
“problemMatcher”: {
“pattern”: {
“regexp”: “”
},
“background”: {
“activeOnStart”: true,
“beginsPattern”: “Listening for transport dt_socket at address: 8999”,
“endsPattern”: “Listening for transport dt_socket at address: 8999”
}
}
}
]
}

Hello.java:
import java.util.concurrent.TimeUnit;

class Hello {
public static void main(String args[]) {
int i = 0;
while (true) {
System.out.println("Hello World " + Integer.toString(i++));
try {
TimeUnit.SECONDS.sleep(1);
} catch (Exception e) {
System.out.println(e.toString());
}
}
}
}

[original thread by TomHermanSAP]

have another confiugration which does not launch task?

I’m not sure what VS Code does in this case. Did you check?