@@ -25,7 +25,7 @@ import {
2525import { getConfiguration } from '../../common/workspace.apis' ;
2626import { getGlobalPersistentState , getWorkspacePersistentState } from '../../common/persistentState' ;
2727import which from 'which' ;
28- import { shortVersion , sortEnvironments } from '../common/utils' ;
28+ import { shortVersion , sortEnvironments , untildify } from '../common/utils' ;
2929import { pickProject } from '../../common/pickers/projects' ;
3030import { CondaStrings } from '../../common/localize' ;
3131import { showErrorMessage } from '../../common/errors/utils' ;
@@ -54,7 +54,8 @@ async function setConda(conda: string): Promise<void> {
5454
5555export function getCondaPathSetting ( ) : string | undefined {
5656 const config = getConfiguration ( 'python' ) ;
57- return config . get < string > ( 'condaPath' ) ;
57+ const value = config . get < string > ( 'condaPath' ) ;
58+ return ( value && typeof value === 'string' ) ? untildify ( value ) : value ;
5859}
5960
6061export async function getCondaForWorkspace ( fsPath : string ) : Promise < string | undefined > {
@@ -113,20 +114,19 @@ async function findConda(): Promise<readonly string[] | undefined> {
113114}
114115
115116export async function getConda ( ) : Promise < string > {
116- const config = getConfiguration ( 'python' ) ;
117- const conda = config . get < string > ( 'condaPath' ) ;
117+ const conda = getCondaPathSetting ( ) ;
118118 if ( conda ) {
119119 return conda ;
120120 }
121121
122122 if ( condaPath ) {
123- return condaPath ;
123+ return untildify ( condaPath ) ;
124124 }
125125
126126 const state = await getWorkspacePersistentState ( ) ;
127127 condaPath = await state . get < string > ( CONDA_PATH_KEY ) ;
128128 if ( condaPath ) {
129- return condaPath ;
129+ return untildify ( condaPath ) ;
130130 }
131131
132132 const paths = await findConda ( ) ;
0 commit comments