Skip to content

Commit 7ce1f05

Browse files
Copiloteleanorjboyd
andcommitted
Changes before error encountered
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
1 parent b1c55d5 commit 7ce1f05

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/managers/conda/condaUtils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,10 @@ async function windowsExceptionGenerateConfig(
549549
traceVerbose(`PS1 hook path: ${ps1Hook ?? 'not found'}`);
550550
const activation = ps1Hook ? ps1Hook : sourceInitPath;
551551

552-
const pwshActivate = [{ executable: activation }, { executable: 'conda', args: ['activate', prefix] }];
552+
// For PowerShell, we need to dot-source the conda-hook.ps1 script
553+
const pwshActivate = ps1Hook
554+
? [{ executable: '.', args: [ps1Hook] }, { executable: 'conda', args: ['activate', prefix] }]
555+
: [{ executable: sourceInitPath }, { executable: 'conda', args: ['activate', prefix] }];
553556
const cmdActivate = [{ executable: sourceInitPath }, { executable: 'conda', args: ['activate', prefix] }];
554557

555558
const bashActivate = [{ executable: 'source', args: [sourceInitPath.replace(/\\/g, '/'), prefix] }];

0 commit comments

Comments
 (0)