admin管理员组文章数量:1026989
When using vs.code, I have to use a non-standard compiler, and it's easier to just run it from Makefile. I have it set up as a task in tasks.json
. I am trying to make my postDebugTask
remain in terminal if there is an error. I am trying to do that with my postDebugTask
called run_flash
.
BUT, if I re-invoke the build or "run" process, I want to terminate all running tasks. I am trying to do this with my preLaunchTask
kill_all_tasks
.
If I launch another process, it does not kill the previous process.
Really, what I want is for any time my normal task is launched, I want to kill off the previous task. Like is there any sort of task option to say "there can only be one of these tasks"?
Here is the launch configuration from my launch.json
{
"name": "Compile and Flash",
"type": "node",
"request": "launch",
"internalConsoleOptions": "neverOpen",
"preLaunchTask" : "kill_all_tasks",
"postDebugTask": "run_flash",
"presentation": {
"hidden": false,
"group": "terminaloutput",
"order": 1
},
"runtimeExecutable": "echo"
}
Here are my tasks:
{
"type": "shell",
"label": "run_flash",
"command": "make clean closechlink; make flash",
"presentation": {
"echo": true,
"focus": true,
"group": "build",
"panel": "shared",
"close": true,
"reveal": "always",
"showReuseMessage": true
},
"isBackground": false,
"options": {
"cwd": "${workspaceFolder}",
},
"runOptions": {
"instanceLimit": 1,
},
"group": "build",
"problemMatcher": { //
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
},
}
},
{
"type": "process",
"label" : "kill_all_tasks",
"command":[
"${command:workbench.action.tasks.terminate} terminateAll",
]
}
When using vs.code, I have to use a non-standard compiler, and it's easier to just run it from Makefile. I have it set up as a task in tasks.json
. I am trying to make my postDebugTask
remain in terminal if there is an error. I am trying to do that with my postDebugTask
called run_flash
.
BUT, if I re-invoke the build or "run" process, I want to terminate all running tasks. I am trying to do this with my preLaunchTask
kill_all_tasks
.
If I launch another process, it does not kill the previous process.
Really, what I want is for any time my normal task is launched, I want to kill off the previous task. Like is there any sort of task option to say "there can only be one of these tasks"?
Here is the launch configuration from my launch.json
{
"name": "Compile and Flash",
"type": "node",
"request": "launch",
"internalConsoleOptions": "neverOpen",
"preLaunchTask" : "kill_all_tasks",
"postDebugTask": "run_flash",
"presentation": {
"hidden": false,
"group": "terminaloutput",
"order": 1
},
"runtimeExecutable": "echo"
}
Here are my tasks:
{
"type": "shell",
"label": "run_flash",
"command": "make clean closechlink; make flash",
"presentation": {
"echo": true,
"focus": true,
"group": "build",
"panel": "shared",
"close": true,
"reveal": "always",
"showReuseMessage": true
},
"isBackground": false,
"options": {
"cwd": "${workspaceFolder}",
},
"runOptions": {
"instanceLimit": 1,
},
"group": "build",
"problemMatcher": { //
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
},
}
},
{
"type": "process",
"label" : "kill_all_tasks",
"command":[
"${command:workbench.action.tasks.terminate} terminateAll",
]
}
本文标签: visual studio codeVSCode tasks that automatically kills all other tasks on invokeStack Overflow
版权声明:本文标题:visual studio code - VSCode tasks that automatically kills all other tasks on invoke - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745664623a2162102.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论