Skip to content

Commit 2a35668

Browse files
authored
fix: ensure that we use new extension when available for terminal creation (#24983)
fixes microsoft/vscode-python-environments#291
1 parent 8478bf0 commit 2a35668

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/client/common/application/commands.ts

+1
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,5 @@ export interface ICommandNameArgumentTypeMapping extends ICommandNameWithoutArgu
107107
},
108108
];
109109
['cursorEnd']: [];
110+
['python-envs.createTerminal']: [undefined | Uri];
110111
}

src/client/providers/terminalProvider.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ export class TerminalProvider implements Disposable {
6060

6161
@captureTelemetry(EventName.TERMINAL_CREATE, { triggeredBy: 'commandpalette' })
6262
private async onCreateTerminal() {
63-
const terminalService = this.serviceContainer.get<ITerminalServiceFactory>(ITerminalServiceFactory);
6463
const activeResource = this.activeResourceService.getActiveResource();
64+
if (useEnvExtension()) {
65+
const commandManager = this.serviceContainer.get<ICommandManager>(ICommandManager);
66+
await commandManager.executeCommand('python-envs.createTerminal', activeResource);
67+
}
68+
69+
const terminalService = this.serviceContainer.get<ITerminalServiceFactory>(ITerminalServiceFactory);
6570
await terminalService.createTerminalService(activeResource, 'Python').show(false);
6671
}
6772
}

0 commit comments

Comments
 (0)