Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export class CondaActivationCommandProvider implements ITerminalActivationComman

const condaEnv = envInfo.name.length > 0 ? envInfo.name : envInfo.path;

// Directly use the self-contained micromamba executable.
if (await this.condaService.isMicroMamba()) {
return [`micromamba activate ${condaEnv.toCommandArgumentForPythonExt()}`];
}

// New version.
const interpreterPath = await this.condaService.getInterpreterPathForEnvironment(envInfo);
const activatePath = await this.condaService.getActivationScriptFromInterpreter(interpreterPath, envInfo.name);
Expand Down
1 change: 1 addition & 0 deletions src/client/interpreter/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface ICondaService {
getCondaFile(forShellExecution?: boolean): Promise<string>;
getCondaInfo(): Promise<CondaInfo | undefined>;
isCondaAvailable(): Promise<boolean>;
isMicroMamba(): Promise<boolean>;
getCondaVersion(): Promise<SemVer | undefined>;
getInterpreterPathForEnvironment(condaEnv: CondaEnvironmentInfo): Promise<string | undefined>;
getCondaFileFromInterpreter(interpreterPath?: string, envName?: string): Promise<string | undefined>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ export class CondaService implements ICondaService {
.catch(() => (this.isAvailable = false)); // eslint-disable-line no-return-assign
}

/**
* Is the conda executable named "micromamba"?
*/
public async isMicroMamba(): Promise<boolean> {
const file = await this.getCondaFile();
const name = path.basename(file, '.exe');
return name === 'micromamba';
}

/**
* Return the conda version.
*/
Expand Down
Loading