Right now I have a long-running "run" task and when I want to run the "test" task it demands that I kill the "run" task.
Here's a prompt that should fix this:
VS Code tasks reuse same terminal; should use dedicated terminal per task
Description
When running tasks via the extension UI, VS Code prompts:
“Terminate running task?”
This happens even when running different tasks (e.g. run and test).
Expected behavior is:
- Each task should have its own terminal
- Re-running the same task should reuse its terminal
- Running a different task should not interfere
Root Cause
Tasks are created without presentationOptions, so VS Code defaults to:
panel: shared
- single active instance
This causes all tasks to share one terminal.
Desired Behavior
Use dedicated terminals per task:
run → its own terminal
test → separate terminal
- re-running
run → reuses only the run terminal
Required Change
In src/taskProvider.ts, inside resolveTask, after creating the task:
const task = new vscode.Task(
definition,
_task.scope ?? vscode.TaskScope.Workspace,
taskName,
'taskfile',
new vscode.ShellExecution(`task ${taskName}`)
);
Add:
task.presentationOptions = {
panel: vscode.TaskPanelKind.Dedicated,
reveal: vscode.TaskRevealKind.Always,
clear: false,
showReuseMessage: false,
};
Notes
- Do not use
panel: Shared (current behavior, causes conflicts)
- Do not use
panel: New (creates infinite terminals)
Dedicated is the correct mode for task-based workflows
Acceptance Criteria
- Running
task run opens terminal A
- Running
task test opens terminal B
- Running
task run again only affects terminal A
- No “Terminate running task?” prompt when running different tasks
Optional Enhancement
Expose a setting:
"goTask.panel": "dedicated" | "shared" | "new"
Default: "dedicated"
This change aligns the extension behavior with expected multi-task workflows and avoids terminal conflicts.
Right now I have a long-running "run" task and when I want to run the "test" task it demands that I kill the "run" task.
Here's a prompt that should fix this:
VS Code tasks reuse same terminal; should use dedicated terminal per task
Description
When running tasks via the extension UI, VS Code prompts:
This happens even when running different tasks (e.g.
runandtest).Expected behavior is:
Root Cause
Tasks are created without
presentationOptions, so VS Code defaults to:panel: sharedThis causes all tasks to share one terminal.
Desired Behavior
Use dedicated terminals per task:
run→ its own terminaltest→ separate terminalrun→ reuses only therunterminalRequired Change
In
src/taskProvider.ts, insideresolveTask, after creating the task:Add:
Notes
panel: Shared(current behavior, causes conflicts)panel: New(creates infinite terminals)Dedicatedis the correct mode for task-based workflowsAcceptance Criteria
task runopens terminal Atask testopens terminal Btask runagain only affects terminal AOptional Enhancement
Expose a setting:
Default:
"dedicated"This change aligns the extension behavior with expected multi-task workflows and avoids terminal conflicts.