diff --git a/src/managers/conda/condaUtils.ts b/src/managers/conda/condaUtils.ts index 15011d16..0e44d0d2 100644 --- a/src/managers/conda/condaUtils.ts +++ b/src/managers/conda/condaUtils.ts @@ -25,7 +25,7 @@ import { import { getConfiguration } from '../../common/workspace.apis'; import { getGlobalPersistentState, getWorkspacePersistentState } from '../../common/persistentState'; import which from 'which'; -import { shortVersion, sortEnvironments } from '../common/utils'; +import { shortVersion, sortEnvironments, untildify } from '../common/utils'; import { pickProject } from '../../common/pickers/projects'; import { CondaStrings } from '../../common/localize'; import { showErrorMessage } from '../../common/errors/utils'; @@ -54,7 +54,8 @@ async function setConda(conda: string): Promise { export function getCondaPathSetting(): string | undefined { const config = getConfiguration('python'); - return config.get('condaPath'); + const value = config.get('condaPath'); + return (value && typeof value === 'string') ? untildify(value) : value; } export async function getCondaForWorkspace(fsPath: string): Promise { @@ -113,20 +114,19 @@ async function findConda(): Promise { } export async function getConda(): Promise { - const config = getConfiguration('python'); - const conda = config.get('condaPath'); + const conda = getCondaPathSetting(); if (conda) { return conda; } if (condaPath) { - return condaPath; + return untildify(condaPath); } const state = await getWorkspacePersistentState(); condaPath = await state.get(CONDA_PATH_KEY); if (condaPath) { - return condaPath; + return untildify(condaPath); } const paths = await findConda();