Add configurable Compose task terminal closing - #597
Conversation
Short-lived Compose group lifecycle commands no longer leave a leftover task terminal; Compose Logs stay open. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Pull request overview
This PR updates the Container Tools extension’s Compose group commands to automatically close the VS Code task terminal after the command completes, aligning the UX with VS Code task presentation.close behavior while keeping Compose Logs streaming output visible.
Changes:
- Added a
close?: booleanoption toTaskCommandRunnerFactoryand thread it intotask.presentationOptions.close. - Enabled
close: truefor Compose group Start, Stop, Restart, and Down commands. - Left Compose group Logs behavior unchanged so the terminal remains open for streaming output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| extensions/vscode-containers/src/runtimes/runners/TaskCommandRunnerFactory.ts | Adds a close option and maps it to VS Code task presentationOptions.close. |
| extensions/vscode-containers/src/commands/containers/composeGroup.ts | Passes close: true for Compose group start/stop/restart/down tasks (logs unchanged). |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Honor maintainer feedback from the sibling microsoft#350 PR: add an advanced setting that defaults to false, apply it to Compose and compose group commands, and cover task presentation options with tests. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Demo of enabled containers.closeComposeTaskTerminal is in the description. Compose commands close the task terminal when they finish. This also includes the later review notes from #588 (setting lookup inlined in composeGroup, nls wording). Ready for review. |
Summary
containers.closeComposeTaskTerminalsetting, disabled by default.focusandclosepresentation options directly so omitted values stay unset and explicitfalseis preserved.This incorporates maintainer feedback from #588 / #363: make terminal closing opt-in, keep the default behavior unchanged, and avoid forcing it on for all commands.
Fixes #350
Test plan
pnpm --filter vscode-containers lintpnpm --filter vscode-containers buildpnpm --filter vscode-containers test(155 passing)containers.closeComposeTaskTerminalenabled: those commands close the terminal when they finish🎥 Video demonstration
https://github.com/user-attachments/assets/2d45bbf0-fb7f-446d-ad6b-55707f454eee