Repository navigation
[docs] Add VS Code Open terminal context menu to terminal docs - #1580
Conversation
…d resources Documents the new 'Open terminal' right-click context menu action added to the Aspire VS Code extension resource tree view in PR microsoft/aspire#18260. Terminal-enabled resources (configured with WithTerminal()) now show an Open terminal entry that runs 'aspire terminal attach <resource>' and opens the session as an editor-style terminal tab. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds documentation for interactive terminal support, the VS Code Open terminal action, and Aspire 13.5 release notes.
Changes:
- Adds a
WithTerminal()guide. - Updates VS Code extension documentation.
- Adds Aspire 13.5 release notes.
Review findings:
- Replica examples should use generated replica IDs.
- The TypeScript
IInteractionServiceclaim must be reconciled with the linked guide.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Summary |
|---|---|
src/frontend/src/content/docs/whats-new/aspire-13-5.mdx |
Adds Aspire 13.5 features and release notes. |
src/frontend/src/content/docs/get-started/aspire-vscode-extension.mdx |
Documents the new terminal context-menu action. |
src/frontend/src/content/docs/app-host/withterminal.mdx |
Adds interactive terminal usage guidance and examples. |
Suppressed comments (4)
src/frontend/src/content/docs/app-host/withterminal.mdx:104
- This C# example applies
WithReplicastoAddExecutable, but the Aspire.Hosting API surface in this checkout definesWithReplicas(this IResourceBuilder<ProjectResource>, int)(src/frontend/src/data/pkgs/Aspire.Hosting.13.4.0.json:23225-23240). SinceAddExecutablereturns an executable resource builder, this sample does not compile; use a project resource for the replica example or remove the replica call.
var agent = builder.AddExecutable("agent", "my-agent", ".")
.WithReplicas(3)
.WithTerminal();
src/frontend/src/content/docs/app-host/withterminal.mdx:118
- The TypeScript replica sample has the same API mismatch:
addNodeAppreturnsNodeAppResource, while the generated 13.4 Aspire API exposeswithReplicas(replicas)only onProjectResource(src/frontend/src/data/ts-modules/Aspire.Hosting.13.4.0.json:8245-8251). As shown,await agent.withReplicas(3)is not a valid call; useaddProjectfor this example or omit the replica section for Node apps.
const agent = await builder
.addNodeApp("agent", "./agent", "index.mjs");
await agent.withReplicas(3);
await agent.withTerminal();
src/frontend/src/content/docs/app-host/withterminal.mdx:2
- This new AppHost page is not registered in the AppHost sidebar. The sidebar explicitly enumerates the AppHost pages and currently ends its resource-type entries at
app-host/executable-resources(src/frontend/config/sidebar/docs.topics.ts:908-939), so the terminal guide is only reachable through the links added here. Addapp-host/withterminalto that sidebar section so the guide is discoverable.
title: Interactive terminal sessions
src/frontend/src/content/docs/app-host/withterminal.mdx:181
- This guide introduces the new
aspire terminal psandaspire terminal attachCLI surface, but the CLI command index atsrc/frontend/src/content/docs/reference/cli/commands/aspire.mdx:45-75has noterminalentry and there is no terminal command reference page. Users browsing the CLI reference will not discover these commands; add the command reference/index entry or link to the new command documentation here.
## See also
- [Executable resources](/app-host/executable-resources/)
- [Resource lifetimes](/app-host/resource-lifetimes/)
- [Aspire CLI reference](/reference/cli/overview/)
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
David Pine (IEvangelist)
left a comment
There was a problem hiding this comment.
Documentation accuracy review
Source of truth: microsoft/aspire main at 022b3abf8ac7a42909c6b4960a10542ce5625c7d
Claims: 10 total — 10 verified, 0 verified-with-nuance, 0 unverifiable, 0 contradicted
Doc test: PR head f96116943b076a3fd32008a26beb898a7889c4a1; 2 affected routes exercised; 0 critical issues, 0 warnings
Phase A — Claim verification
No blocking or advisory findings.
Verified claims and source evidence (10)
| ID | PR location | Verified claim | Source evidence |
|---|---|---|---|
| C-01 | with-terminal.mdx:187 |
WithTerminal() resources receive an Open terminal right-click action. |
The localized label is Open terminal, the context-menu item is gated by canOpenTerminal, and the resource context adds that marker only when terminal support is enabled (treePresentation.ts:100-126). |
| C-02 | with-terminal.mdx:187 |
Selecting the action runs aspire terminal attach <resource>. |
openResourceTerminal() builds ['terminal', 'attach', resourceName]. |
| C-03 | with-terminal.mdx:187 |
The command opens in a VS Code editor-area terminal tab. | The action requests terminalTarget: 'editor', which selects createAspireEditorTerminal and TerminalLocation.Editor. |
| C-04 | with-terminal.mdx:189 |
Replica-aware attachment adds --replica <index>. |
The extension reads the replica index and appends --replica; the property lookup is defined in getTerminalReplicaIndex(). |
| C-05 | with-terminal.mdx:189 |
--apphost is added when the extension can resolve the AppHost path. |
openResourceTerminal() conditionally appends --apphost, using the resource/AppHost/workspace path resolver in the same provider. |
| C-06 | with-terminal.mdx:189 |
Passing --apphost avoids requiring the user to identify the AppHost separately. |
The attach command exposes the --apphost / --project option and supplies it to AppHost connection resolution. |
| C-07 | with-terminal.mdx:192 |
The menu action is visible only when terminal.enabled is true. |
isTerminalEnabled() controls the canOpenTerminal context marker used by the menu gate. |
| C-08 | with-terminal.mdx:192 |
Calling WithTerminal() causes terminal.enabled = "true" to be published. |
AddTerminalProperties() detects TerminalAnnotation and emits the enabled property. |
| C-09 | with-terminal.mdx:192 |
Without WithTerminal(), the menu action is absent. |
Without TerminalAnnotation, snapshot enrichment returns without adding terminal properties, so the context-menu gate is not satisfied. |
| C-10 | aspire-vscode-extension.mdx:90 |
The resource context menu can open an interactive terminal for WithTerminal() resources. |
Verified by the same command-registration, context-gating, and terminal-snapshot chain above; the new /app-host/with-terminal/ cross-reference also resolves successfully. |
Phase B — Doc-tester results
Documentation Test Report
Focus Area: VS Code Open terminal additions
Date: 2026-08-26
Tester: doc-tester agent
PR ref served: f96116943b076a3fd32008a26beb898a7889c4a1
Local server: http://localhost:4323/
Routes and sections exercised:
/app-host/with-terminal/#access-terminals-from-vs-code/get-started/aspire-vscode-extension/— The Aspire view section and its newWithTerminal()link
Summary
| Category | Passed | Failed | Warnings |
|---|---|---|---|
| Content rendering and clarity | 2 | 0 | 0 |
| Code examples | 0 | 0 | 0 |
| CLI commands | 0 | 0 | 0 |
| Links and section navigation | 2 | 0 | 0 |
Critical Issues
None.
Warnings
None.
Passed Checks
- The new Access terminals from VS Code section renders completely, including inline command/flag formatting and the note.
- The new section appears in the page table of contents, and its anchor navigates to
#access-terminals-from-vs-code. - The VS Code extension page renders the new
WithTerminal()cross-reference with the required site-relative, trailing-slash URL. - Clicking that cross-reference loads
/app-host/with-terminal/successfully with the expected page title and content. - The added text is understandable in context without relying on prior Aspire knowledge.
Recommendations
None.
Knowledge Gaps
None. Phase B intentionally remained source-blind. The VS Code extension action itself was not launched from the local docs site; its behavior is independently covered by Phase A's source verification.
Documents changes from microsoft/aspire#18260
Fixes: #1282