Closed BillDenton closed 7 years ago
This is already available in the new task runner. Raise the version of the tasks.json to 2.0.0.
I will close the issue although the terminal runner is not the default yet. But there are no plans to add parallel task support to the output based task runner.
Changed to: "version": "2.0.0", How do I run a independent task? Where's the documentation for 2.0.0
@BillDenton in the works since it is not the default yet. Basic documentation is in the release notes of the previous releases.
I couldn't find anything applicable in the release notes. Using the information in http://stackoverflow.com/questions/41105361/how-to-run-background-task-in-vs-code-under-windows, the best I've managed so far is:
{
"taskName": "Notepad",
"suppressTaskName": true,
"command": "powershell",
"args": [ "(New-Object -ComObject WScript.Shell).Run('notepad', 1, $false)" ]
}
Note: My actual tasks are more complex as they use the current filename and other parameters. This was just for testing. This runs independently so I can launch other tasks (including more of these) immediately. It prompts to "Press any key to close the terminal", which isn't much use in this case as there isn't anything interesting in the terminal. Obviously for a build task it would be useful to see the terminal.
Is is possible to have the terminal automatically close once the task has finished?
Currently not, but there are requests to get better control over this.
Do you have issue numbers for those requests?
Now, the new task runner is the default, is there a method for launching independent tasks? Or do I still need to use the method above?
Yes, you can now run n tasks in parallel.
To summarise my understanding: Different tasks (as named by "taskName" in tasks.json) can run in separate terminals. I was trying to run task which is external to VS Code so it isn't monitored for completion, another instance of the same task could be run and would continue running after VS Code exits (and doesn't block exit). I have succeeded in doing this by: { "taskName": "Example", "group": "none", "type": "shell", "problemMatcher": [], "presentation": { "echo": true, "reveal": "never", "focus": false, "panel": "dedicated" }, "options": { "cwd": "${workspaceRoot}\example" }, "command": "", "args": [ "start \"\" python example.pyw" ] },
Another question: Is it possible to group tasks so that common parameters don't have to be repeated for each task.
@BillDenton there is currently no support to group tasks. Feel free to open a feature request.
Raised defect #30636 for support of grouping tasks.
Steps to Reproduce: