Skip to content

Add configurable Compose task terminal closing - #597

Open
rtwwhat wants to merge 2 commits into
microsoft:mainfrom
rtwwhat:fix/350-compose-presentation-options
Open

Add configurable Compose task terminal closing#597
rtwwhat wants to merge 2 commits into
microsoft:mainfrom
rtwwhat:fix/350-compose-presentation-options

Conversation

@rtwwhat

@rtwwhat rtwwhat commented Aug 30, 2026

Copy link
Copy Markdown

Summary

  • Add an advanced containers.closeComposeTaskTerminal setting, disabled by default.
  • Apply the setting to Compose commands and Compose group lifecycle actions.
  • Map task focus and close presentation options directly so omitted values stay unset and explicit false is 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 lint
  • pnpm --filter vscode-containers build
  • pnpm --filter vscode-containers test (155 passing)
  • With containers.closeComposeTaskTerminal enabled: those commands close the terminal when they finish
  • Compose Logs stays usable (long-running follow output)
🎥 Video demonstration

https://github.com/user-attachments/assets/2d45bbf0-fb7f-446d-ad6b-55707f454eee

Short-lived Compose group lifecycle commands no longer leave a leftover task terminal; Compose Logs stay open.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rtwwhat
rtwwhat requested a review from a team as a code owner August 30, 2026 10:41
Copilot AI lite review requested due to automatic review settings August 30, 2026 10:41
@rtwwhat

rtwwhat commented Aug 30, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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?: boolean option to TaskCommandRunnerFactory and thread it into task.presentationOptions.close.
  • Enabled close: true for 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>
@rtwwhat rtwwhat changed the title Close compose group task terminals after start, stop, restart, and down Add configurable Compose task terminal closing Aug 30, 2026
@rtwwhat

rtwwhat commented Sep 1, 2026

Copy link
Copy Markdown
Author

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.

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.

Add presentation options to Docker extension's compose commands

2 participants