terminal: Allow configuring conda manager#40577
Merged
Veykril merged 6 commits intozed-industries:mainfrom Nov 7, 2025
Merged
Conversation
Veykril
reviewed
Oct 26, 2025
crates/languages/src/python.rs
Outdated
| // Honor conda manager preference via env var ZED_CONDA_MANAGER if set: | ||
| // accepts "conda", "mamba", or "micromamba". Otherwise, use the detected | ||
| // manager executable if available, falling back to "conda". | ||
| let manager_cmd = std::env::var("ZED_CONDA_MANAGER") |
Member
There was a problem hiding this comment.
Why do we need an env var for this?
Contributor
Author
There was a problem hiding this comment.
That's how conda and micromamba handles the exe
Contributor
Author
There was a problem hiding this comment.
Need to make this compat with how zed does this too. See https://github.com/zed-industries/zed/blob/8e4031815d664516f19c46e830d7b2cd550a72f7/crates/repl/src/kernels/native_kernel.rs#L418C1-L423C6
Veykril
reviewed
Oct 31, 2025
Contributor
05202ec to
6d9f828
Compare
Contributor
Author
|
@Veykril pinging for awareness |
Veykril
approved these changes
Nov 7, 2025
Member
|
Thanks! |
tomatitito
pushed a commit
to tomatitito/zed
that referenced
this pull request
Nov 7, 2025
Closes zed-industries#40576 This PR makes Conda activation configurable and transparent by adding a `terminal.detect_venv.on.conda_manager` setting (`"auto" | "conda" | "mamba" | "micromamba"`, default `"auto"`), updating Python environment activation to honor this preference (or the detected manager executable) and fall back to `conda` when necessary. The preference is passed via `ZED_CONDA_MANAGER` from the terminal settings, and the activation command is built accordingly (with proper quoting for paths). Changes span `zed/crates/terminal/src/terminal_settings.rs` (new `CondaManager` and setting), `zed/crates/project/src/terminals.rs` (inject env var), `zed/crates/languages/src/python.rs` (activation logic), and `zed/assets/settings/default.json` (document the setting). Default behavior remains unchanged for most users while enabling explicit selection of `mamba` or `micromamba`. Release Notes: - Added: terminal.detect_venv.on.conda_manager setting to choose the Conda manager (auto, conda, mamba, micromamba). Default: auto. - Changed: Python Conda environment activation now respects the configured manager, otherwise uses the detected environment manager executable, and falls back to conda. - Reliability: Activation commands quote manager paths to handle spaces across platforms. - Compatibility: No breaking changes; non-Conda environments are unaffected; remote terminals are supported. --------- Co-authored-by: Lukas Wirth <me@lukaswirth.dev> Co-authored-by: Lukas Wirth <lukas@zed.dev>
11happy
pushed a commit
to 11happy/zed
that referenced
this pull request
Dec 1, 2025
Closes zed-industries#40576 This PR makes Conda activation configurable and transparent by adding a `terminal.detect_venv.on.conda_manager` setting (`"auto" | "conda" | "mamba" | "micromamba"`, default `"auto"`), updating Python environment activation to honor this preference (or the detected manager executable) and fall back to `conda` when necessary. The preference is passed via `ZED_CONDA_MANAGER` from the terminal settings, and the activation command is built accordingly (with proper quoting for paths). Changes span `zed/crates/terminal/src/terminal_settings.rs` (new `CondaManager` and setting), `zed/crates/project/src/terminals.rs` (inject env var), `zed/crates/languages/src/python.rs` (activation logic), and `zed/assets/settings/default.json` (document the setting). Default behavior remains unchanged for most users while enabling explicit selection of `mamba` or `micromamba`. Release Notes: - Added: terminal.detect_venv.on.conda_manager setting to choose the Conda manager (auto, conda, mamba, micromamba). Default: auto. - Changed: Python Conda environment activation now respects the configured manager, otherwise uses the detected environment manager executable, and falls back to conda. - Reliability: Activation commands quote manager paths to handle spaces across platforms. - Compatibility: No breaking changes; non-Conda environments are unaffected; remote terminals are supported. --------- Co-authored-by: Lukas Wirth <me@lukaswirth.dev> Co-authored-by: Lukas Wirth <lukas@zed.dev>
Veykril
pushed a commit
that referenced
this pull request
Dec 15, 2025
CherryWorm
pushed a commit
to CherryWorm/zed
that referenced
this pull request
Dec 16, 2025
Closes zed-industries#44645 This is a continuation of zed-industries#40577 Release Notes: - initializes micromamba based on the shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #40576
This PR makes Conda activation configurable and transparent by adding a
terminal.detect_venv.on.conda_managersetting ("auto" | "conda" | "mamba" | "micromamba", default"auto"), updating Python environment activation to honor this preference (or the detected manager executable) and fall back tocondawhen necessary.The preference is passed via
ZED_CONDA_MANAGERfrom the terminal settings, and the activation command is built accordingly (with proper quoting for paths). Changes spanzed/crates/terminal/src/terminal_settings.rs(newCondaManagerand setting),zed/crates/project/src/terminals.rs(inject env var),zed/crates/languages/src/python.rs(activation logic), andzed/assets/settings/default.json(document the setting). Default behavior remains unchanged for most users while enabling explicit selection ofmambaormicromamba.Release Notes: