@@ -1046,6 +1046,7 @@ export async function createPrefixCondaEnvironment(
10461046export async function generateName ( fsPath : string ) : Promise < string | undefined > {
10471047 let attempts = 0 ;
10481048 while ( attempts < 5 ) {
1049+ attempts ++ ;
10491050 const randomStr = Math . random ( ) . toString ( 36 ) . substring ( 2 ) ;
10501051 const name = `env_${ randomStr } ` ;
10511052 const prefix = path . join ( fsPath , name ) ;
@@ -1074,32 +1075,16 @@ export async function quickCreateConda(
10741075 } ,
10751076 async ( ) => {
10761077 try {
1078+ const conda = await getConda ( ) ;
10771079 await runCondaExecutable ( [ 'create' , '--yes' , '--prefix' , prefix , 'python' ] , log ) ;
10781080 if ( additionalPackages && additionalPackages . length > 0 ) {
10791081 await runConda ( [ 'install' , '--yes' , '--prefix' , prefix , ...additionalPackages ] , log ) ;
10801082 }
10811083 const version = await getVersion ( prefix ) ;
10821084
1085+ // Use proper prefix-based activation with actual conda path
10831086 const environment = api . createPythonEnvironmentItem (
1084- {
1085- name : path . basename ( prefix ) ,
1086- environmentPath : Uri . file ( prefix ) ,
1087- displayName : `${ version } (${ name } )` ,
1088- displayPath : prefix ,
1089- description : prefix ,
1090- version,
1091- execInfo : {
1092- run : { executable : execPath } ,
1093- activatedRun : {
1094- executable : execPath ,
1095- args : [ ] ,
1096- } ,
1097- activation : [ { executable : 'conda' , args : [ 'activate' , prefix ] } ] ,
1098- deactivation : [ { executable : 'conda' , args : [ 'deactivate' ] } ] ,
1099- } ,
1100- sysPrefix : prefix ,
1101- group : 'Prefix' ,
1102- } ,
1087+ await getPrefixesCondaPythonInfo ( prefix , execPath , version , conda , manager ) ,
11031088 manager ,
11041089 ) ;
11051090 return environment ;
0 commit comments