# python: Stop falling back to \`conda activate base\` for nameless toolchains \(\#56785\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7cb01e42ef8766b18a919410ce2708135ca7ea46)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7cb01e42ef8766b18a919410ce2708135ca7ea46

Requested commit: 7cb01e42ef8766b18a919410ce2708135ca7ea46

Commit: 7cb01e42ef8766b18a919410ce2708135ca7ea46

Tree: 37e66fc39eeb5890ca94fbf954d5074ef22df35b

Author: Kyle Kelley

Committer: GitHub

## Message

```
python: Stop falling back to `conda activate base` for nameless toolchains (#56785)

Stops the `conda activate base` fallback in
`PythonToolchainProvider::activation_script` for two cases:

1. A Conda toolchain whose `environment.name` is `None`.
2. A Conda toolchain whose name is `Some(...)` but `shell.try_quote`
rejects it.

Previously both cases pushed `conda activate base` into the activation
script. With miniforge installed and no env explicitly selected, every
terminal silently activated `(base)`. The user didn't pick `base`;
injecting it is contamination.

Both branches now log a warning and emit no activation line. Users who
want `(base)` can select it as the toolchain explicitly.

Two unit tests cover the new behavior:
`test_conda_activation_skips_when_name_missing` (name=None) and
`test_conda_activation_skips_unquotable_name` (name=Some but unquotable,
exercised with an embedded NUL byte that `shlex::try_quote` rejects).
The existing `test_conda_activation_script_injection` still verifies
that quotable names get activated.

Release Notes:

- Fixed Zed silently injecting `conda activate base` into terminals when
a Conda manager (miniforge/miniconda) was installed but no specific
environment was selected.
```

## Parents

- [ee591c04ae9fc637c8f9e8eb1718118192c12d9a](https://git.cafe/gitcafe/zed/commit/ee591c04ae9fc637c8f9e8eb1718118192c12d9a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7cb01e42ef8766b18a919410ce2708135ca7ea46?format=markdown)
