Skip to content

Commit

Permalink
Fix activation for powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Raj committed Aug 3, 2023
1 parent d39baec commit 2092cea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/interpreter/activation/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class EnvironmentActivationService implements IEnvironmentActivationServi
args.forEach((arg, i) => {
args[i] = arg.toCommandArgumentForPythonExt();
});
const command = `echo '${ENVIRONMENT_PREFIX}' && ${interpreterPath} ${args.join(' ')}`;
const command = `${interpreterPath} ${args.join(' ')}`;
const processService = await this.processServiceFactory.create(resource);
const result = await processService.shellExec(command, {
shell: shell,
Expand Down Expand Up @@ -277,7 +277,8 @@ export class EnvironmentActivationService implements IEnvironmentActivationServi
const activationCommand = fixActivationCommands(activationCommands).join(' && ');
// In order to make sure we know where the environment output is,
// put in a dummy echo we can look for
command = `${activationCommand} && echo '${ENVIRONMENT_PREFIX}' && python ${args.join(' ')}`;
const commandSeparator = [TerminalShellType.powershell, TerminalShellType.powershellCore].includes(shellInfo.shellType) ? ';' : '&&';
command = `${activationCommand} ${commandSeparator} echo '${ENVIRONMENT_PREFIX}' ${commandSeparator} python ${args.join(' ')}`;
}

// Make sure python warnings don't interfere with getting the environment. However
Expand Down

0 comments on commit 2092cea

Please sign in to comment.