From 845ab116b4eb6a6bd6b395afc1222e76810038f7 Mon Sep 17 00:00:00 2001 From: Andrew Devasia Date: Thu, 29 Jan 2026 09:03:01 +0530 Subject: [PATCH] Add close option for compose group commands --- src/commands/compose/compose.ts | 1 + src/commands/containers/composeGroup.ts | 12 +++++++----- src/commands/images/buildImage.ts | 1 + src/commands/images/pullImage.ts | 3 ++- src/commands/images/pushImage/ImagePushStep.ts | 3 ++- src/commands/images/runImage.ts | 1 + src/commands/registries/logOutOfDockerCli.ts | 3 ++- src/commands/registries/pullImages.ts | 1 + src/runtimes/runners/TaskCommandRunnerFactory.ts | 14 ++++++++++---- 9 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/commands/compose/compose.ts b/src/commands/compose/compose.ts index 0338c2a7..068667b1 100644 --- a/src/commands/compose/compose.ts +++ b/src/commands/compose/compose.ts @@ -77,6 +77,7 @@ async function compose(context: IActionContext, commands: ('up' | 'down' | 'upSu const taskCRF = new TaskCommandRunnerFactory({ taskName: client.displayName, workspaceFolder: folder, + close: true, }); await taskCRF.getCommandRunner()(terminalCommand); diff --git a/src/commands/containers/composeGroup.ts b/src/commands/containers/composeGroup.ts index 6aa86382..01bd41d0 100644 --- a/src/commands/containers/composeGroup.ts +++ b/src/commands/containers/composeGroup.ts @@ -18,19 +18,19 @@ export async function composeGroupLogs(context: IActionContext, node: ContainerG } export async function composeGroupStart(context: IActionContext, node: ContainerGroupTreeItem): Promise { - return composeGroup(context, (client, options) => client.start(options), node); + return composeGroup(context, (client, options) => client.start(options), node, undefined, true); } export async function composeGroupStop(context: IActionContext, node: ContainerGroupTreeItem): Promise { - return composeGroup(context, (client, options) => client.stop(options), node); + return composeGroup(context, (client, options) => client.stop(options), node, undefined, true); } export async function composeGroupRestart(context: IActionContext, node: ContainerGroupTreeItem): Promise { - return composeGroup(context, (client, options) => client.restart(options), node); + return composeGroup(context, (client, options) => client.restart(options), node, undefined, true); } export async function composeGroupDown(context: IActionContext, node: ContainerGroupTreeItem): Promise { - return composeGroup(context, (client, options) => client.down(options), node); + return composeGroup(context, (client, options) => client.down(options), node, undefined, true); } type AdditionalOptions = Omit; @@ -39,7 +39,8 @@ async function composeGroup( context: IActionContext, composeCommandCallback: (client: IContainerOrchestratorClient, options: TOptions) => Promise, node: ContainerGroupTreeItem, - additionalOptions?: AdditionalOptions + additionalOptions?: AdditionalOptions, + close?: boolean ): Promise { if (!node) { await ext.containersTree.refresh(context); @@ -70,6 +71,7 @@ async function composeGroup( const taskCRF = new TaskCommandRunnerFactory({ taskName: client.displayName, cwd: workingDirectory, + ...(close !== undefined && { close }), }); await taskCRF.getCommandRunner()(composeCommandCallback(client, options)); diff --git a/src/commands/images/buildImage.ts b/src/commands/images/buildImage.ts index 59e6f3f9..d587bc45 100644 --- a/src/commands/images/buildImage.ts +++ b/src/commands/images/buildImage.ts @@ -100,6 +100,7 @@ export async function buildImage(context: IActionContext, dockerFileUri: vscode. taskName: client.displayName, workspaceFolder: rootFolder, focus: true, + close: true, }); await taskCRF.getCommandRunner()(terminalCommand); diff --git a/src/commands/images/pullImage.ts b/src/commands/images/pullImage.ts index b52aba70..561e1e02 100644 --- a/src/commands/images/pullImage.ts +++ b/src/commands/images/pullImage.ts @@ -24,7 +24,8 @@ export async function pullImage(context: IActionContext, node?: ImageTreeItem, n const client = await ext.runtimeManager.getClient(); const taskCRF = new TaskCommandRunnerFactory( { - taskName: l10n.t('Pull images') + taskName: l10n.t('Pull images'), + close: true, } ); diff --git a/src/commands/images/pushImage/ImagePushStep.ts b/src/commands/images/pushImage/ImagePushStep.ts index 5ff5164f..bfef997a 100644 --- a/src/commands/images/pushImage/ImagePushStep.ts +++ b/src/commands/images/pushImage/ImagePushStep.ts @@ -18,7 +18,8 @@ export class ImagePushStep extends AzureWizardExecuteStep' ? node.imageId : node.fullTag, alwaysRunNew: interactive, + close: !interactive, } ); diff --git a/src/commands/registries/logOutOfDockerCli.ts b/src/commands/registries/logOutOfDockerCli.ts index b803f02a..c82c08bc 100644 --- a/src/commands/registries/logOutOfDockerCli.ts +++ b/src/commands/registries/logOutOfDockerCli.ts @@ -23,7 +23,8 @@ export async function logOutOfDockerCli(context: IActionContext, node?: UnifiedR const client = await ext.runtimeManager.getClient(); const taskCRF = new TaskCommandRunnerFactory( { - taskName: 'Container Tools' + taskName: 'Container Tools', + close: true, } ); diff --git a/src/commands/registries/pullImages.ts b/src/commands/registries/pullImages.ts index fdd258e8..babe8e24 100644 --- a/src/commands/registries/pullImages.ts +++ b/src/commands/registries/pullImages.ts @@ -35,6 +35,7 @@ async function pullImages(context: IActionContext, node: UnifiedRegistryItem