Skip to content

Auto-close Simple Browser tab when debug session ends #15895

@adamint

Description

@adamint

Description

When using the simpleBrowser option for aspire.dashboardBrowser, the Simple Browser tab should automatically close when the Aspire debug session ends (if aspire.closeDashboardOnDebugEnd is enabled).

This is currently blocked on VS Code — Simple Browser tabs report tab.input as undefined in the vscode.window.tabGroups API, making it impossible to reliably identify which tab is the dashboard Simple Browser tab. Without this, we risk closing an unrelated Simple Browser tab that the user opened independently.

What's needed from VS Code

VS Code needs to expose a proper TabInput type for Simple Browser tabs (e.g. TabInputWebview with a viewType or URL) so extensions can identify them. Currently:

// This is what we'd want to do, but tab.input is undefined for Simple Browser tabs
for (const group of vscode.window.tabGroups.all) {
    for (const tab of group.tabs) {
        // tab.input is undefined for Simple Browser — can't match by URL
    }
}

Related issues

Implementation plan (once unblocked)

In closeDashboard() in AspireDebugSession.ts, find the Simple Browser tab by its URL/input type and close it via vscode.window.tabGroups.close().

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions