Skip to content

Better sessions terminal tracking#299308

Merged
benibenj merged 1 commit intomainfrom
benibenj/wet-swift
Mar 4, 2026
Merged

Better sessions terminal tracking#299308
benibenj merged 1 commit intomainfrom
benibenj/wet-swift

Conversation

@benibenj
Copy link
Contributor

@benibenj benibenj commented Mar 4, 2026

Copilot Generated Description: Improve tracking of externally created terminals by associating them with the active session based on their current working directory. Add functionality to hide terminals that do not match the active session's context. Include a new action to dump terminal tracking information for debugging purposes.

Copilot AI review requested due to automatic review settings March 4, 2026 22:38
@benibenj benibenj enabled auto-merge March 4, 2026 22:38
@benibenj benibenj self-assigned this Mar 4, 2026
@vs-code-engineering vs-code-engineering bot added this to the 1.111.0 milestone Mar 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves terminal tracking in the Agent Sessions window by attempting to “adopt” terminals created outside the contribution (eg restored/external terminals) into the active session based on their initial working directory, and by hiding terminals that cannot be related to the active session. It also adds a command for dumping terminal tracking state for debugging.

Changes:

  • Adopt (or hide) externally-created/restored terminals by comparing their initial cwd against the active session context.
  • Add a debug action/command to dump tracked vs untracked terminals.
  • Extend the sessions terminal contribution tests to cover adoption/hiding behavior for external terminals.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.ts Adds external terminal adoption logic, introduces a dump-tracking command, and adjusts creation handling to avoid immediately backgrounding untracked terminals.
src/vs/sessions/contrib/terminal/test/browser/sessionsTerminalContribution.test.ts Adds terminal instance stubs that support getInitialCwd() and new tests validating adoption/hiding behavior.

You can also share your feedback on Copilot code review. Take the survey.

@benibenj benibenj merged commit fa505bc into main Mar 4, 2026
24 checks passed
@benibenj benibenj deleted the benibenj/wet-swift branch March 4, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants