mamba-org / vscode-micromamba

A VSCode extension to generate development environments using micromamba and conda-forge package repository
BSD 3-Clause "New" or "Revised" License
82 stars 10 forks source link

Use new EnvironmentVariableCollection API #51

Closed anton-matosov closed 1 month ago

anton-matosov commented 2 months ago

new EnvironmentVariableCollection API introduced in https://github.com/microsoft/vscode/issues/179476 allows to (re)apply environment variables at the shell integration stage. This is crucial for macOS which uses login shell as default and overrides or prepends set PATH on startup, leading to micromamba paths being absent or push towards the end. This results in system binaries being used as default, essentially deactivating the conda environment

Update @types/vscode and @vscode/test-electron to the latest versions to allow use of the new API

Pass in EnvironmentVariableMutatorOptions{ applyAtProcessCreation: true, applyAtShellIntegration: true } to guarantee PATH and other environment variables reapplication after default shell initializtion is complete

Add filtering of the standard shell and vscode environment variables in parseMicromambaShellActivateResponse in order to avoid attempting to change read-only variables like PWD and SHLVL as well as causing potential side effects with process specific variables like VSCODE_ (see in code comments for more details)

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10086318472

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/activations/activateTerminal.ts 0 5 0.0%
<!-- Total: 4 9 44.44% -->
Totals Coverage Status
Change from base Build 9595185128: 0.5%
Covered Lines: 397
Relevant Lines: 620

💛 - Coveralls