diff --git a/package.json b/package.json index 3b724d9c2c..dce34a13af 100644 --- a/package.json +++ b/package.json @@ -1821,7 +1821,7 @@ "default": [ { "label": "Compose Down", - "template": "${composeCommand} ${configurationFile} down" + "template": "${composeCommand} ${profileList} ${configurationFile} down" } ], "description": "%vscode-docker.config.template.composeDown.description%" diff --git a/src/commands/compose/compose.ts b/src/commands/compose/compose.ts index b85ce40047..b0b8b4dff7 100644 --- a/src/commands/compose/compose.ts +++ b/src/commands/compose/compose.ts @@ -66,7 +66,7 @@ async function compose(context: IActionContext, commands: ('up' | 'down' | 'upSu if (!terminalCommand.args?.length) { // Add the service list if needed terminalCommand.command = await addServicesOrProfilesIfNeeded(context, folder, terminalCommand.command, preselectedServices, preselectedProfiles); - } else if (command === 'upSubset') { + } else if (command === 'upSubset' || command === 'down') { // If there are arguments, it means we're using a default command (based on the logic in selectCommandTemplate.ts) // So, we only want to add profile/service list for the upSubset command terminalCommand = await addDefaultCommandServicesOrProfilesIfNeeded(context, folder, terminalCommand, preselectedServices, preselectedProfiles); diff --git a/src/commands/compose/getComposeSubsetList.ts b/src/commands/compose/getComposeSubsetList.ts index 3da7eb94ce..781da08bdb 100644 --- a/src/commands/compose/getComposeSubsetList.ts +++ b/src/commands/compose/getComposeSubsetList.ts @@ -30,6 +30,8 @@ export async function getDefaultCommandComposeProfilesOrServices(context: IActio useProfiles = true; } else if (preselectedServices?.length) { useProfiles = false; + } else if (composeCommand.args.includes('down')) { + useProfiles = true; } else if (profiles?.length) { const profilesOrServices: IAzureQuickPickItem[] = [ {