Skip to content

Let me run multiple tasks in different terminals #250

@ubershmekel

Description

@ubershmekel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions