From aee66ea6854b6647d58922948be2777605601efa Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 14 Apr 2025 09:24:31 -0700 Subject: [PATCH] fix: ensure that we use new extension when available for terminal creation --- src/client/common/application/commands.ts | 1 + src/client/providers/terminalProvider.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/common/application/commands.ts b/src/client/common/application/commands.ts index 2195fe09aabf..98ea2669d773 100644 --- a/src/client/common/application/commands.ts +++ b/src/client/common/application/commands.ts @@ -107,4 +107,5 @@ export interface ICommandNameArgumentTypeMapping extends ICommandNameWithoutArgu }, ]; ['cursorEnd']: []; + ['python-envs.createTerminal']: [undefined | Uri]; } diff --git a/src/client/providers/terminalProvider.ts b/src/client/providers/terminalProvider.ts index 407a5520b29a..841f479269ac 100644 --- a/src/client/providers/terminalProvider.ts +++ b/src/client/providers/terminalProvider.ts @@ -60,8 +60,13 @@ export class TerminalProvider implements Disposable { @captureTelemetry(EventName.TERMINAL_CREATE, { triggeredBy: 'commandpalette' }) private async onCreateTerminal() { - const terminalService = this.serviceContainer.get(ITerminalServiceFactory); const activeResource = this.activeResourceService.getActiveResource(); + if (useEnvExtension()) { + const commandManager = this.serviceContainer.get(ICommandManager); + await commandManager.executeCommand('python-envs.createTerminal', activeResource); + } + + const terminalService = this.serviceContainer.get(ITerminalServiceFactory); await terminalService.createTerminalService(activeResource, 'Python').show(false); } }