Skip to content

[ENHANCEMENT] Ability to select specific terminal instance when using @terminal to prevent context pollution #10622

@Rayano79

Description

@Rayano79

Problem (one or two sentences)

Currently, using @Terminal attaches the output from all active terminal instances indiscriminately. This floods the LLM context with irrelevant logs (e.g., from background processes or installation tabs), wasting tokens and degrading model performance.

Context (who is affected and when)

This affects users working with multiple terminal tabs (e.g., one for server logs, another for git commands, and a third for package installation). When a user needs the LLM to analyze an error in just one specific tab, they are currently forced to close all other tabs to isolate the context, which disrupts the workflow.

Desired behavior (conceptual, not technical)

When invoking @Terminal, the interface should allow the user to select a specific open terminal instance by its name. The context sent to the LLM should be strictly limited to the logs/output of that selected instance, rather than merging all open terminals.

Constraints / preferences (optional)

It would be ideal to keep the UI selection quick, perhaps appearing as a sub-list when typing @Terminal, or allowing a syntax like @Terminal:name.

Request checklist

  • I've searched existing Issues and Discussions for duplicates
  • This describes a specific problem with clear context and impact

Roo Code Task Links (optional)

No response

Acceptance criteria (optional)

1.User can distinguish between multiple open terminal instances in the context picker.

2.Selecting a specific terminal sends only that instance's buffer to the LLM.

3.Token usage is reduced by excluding irrelevant terminal outputs.

Proposed approach (optional)

Modify the @Terminal context provider to enumerate active VS Code terminal instances. Instead of a single action that grabs all buffers, present a list of instances (using window.terminals API) for the user to pick from.

Trade-offs / risks (optional)

This adds a slight UI layer to the selection process. To mitigate friction for users who do want everything, an "All Terminals" option could be retained as a choice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or requestIssue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions