Skip to content

terminal: Allow configuring conda manager#40577

Merged
Veykril merged 6 commits intozed-industries:mainfrom
cvanelteren:choose-conda
Nov 7, 2025
Merged

terminal: Allow configuring conda manager#40577
Veykril merged 6 commits intozed-industries:mainfrom
cvanelteren:choose-conda

Conversation

@cvanelteren
Copy link
Contributor

Closes #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.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 18, 2025
// 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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need an env var for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's how conda and micromamba handles the exe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zed-industries-bot
Copy link
Contributor

zed-industries-bot commented Oct 31, 2025

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against f9a303c

@cvanelteren cvanelteren marked this pull request as draft October 31, 2025 17:11
@cvanelteren cvanelteren marked this pull request as ready for review November 2, 2025 13:25
@cvanelteren
Copy link
Contributor Author

@Veykril pinging for awareness

@Veykril Veykril changed the title Choose conda terminal: Allow configuring conda manager Nov 7, 2025
@Veykril Veykril enabled auto-merge (squash) November 7, 2025 12:22
@Veykril
Copy link
Member

Veykril commented Nov 7, 2025

Thanks!

@Veykril Veykril merged commit 9d52b6c into zed-industries:main Nov 7, 2025
24 checks passed
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
Closes #44645

This is a continuation of #40577

Release Notes:
- initializes micromamba based on the shell
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants