microsoft / microsoft/vscode-python-environments
`python-envs.terminal.autoActivationType` migration script incorrectly targets Workspace settings instead of User settings
@StellaHuang95 ya está trabajando en esto.
Desde el 24/6/2026.
- Lenguaje dominante
- TypeScript
- Estrellas
- 138
- Forks
- 62
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 35
Descripción
## Environment data
- Python Environments extension version: 1.37.2026062401
- Python extension (ms-python.python) version: 2026.4.0
- VS Code version (Help -> About): 1.126.0
- OS and version: Win 11
- Python version (& distribution if applicable, e.g. Anaconda): Different CPython versions managed with Pyenv.
- Environment manager in use (venv / conda / pyenv / poetry / pipenv / system / uv / other): pyenv, pipenv, uv, venv, poetry...
- Shell (bash / zsh / fish / pwsh / cmd / other): bash, pwshell
- Remote / container scenario (none / WSL / SSH Remote / Dev Container / Codespaces): none
- Workspace type (single folder / multi-root / mono-repo): single folder multi repo
- Is this a regression? If yes, last known working extension version: No afaik
## Repro Steps
1. Configure legacy Python terminal activation settings to be disabled (off or none).
* "python.terminal.activateEnvironment": false,
2. Open a project workspace folder.
3. Check Extension Host Output channel.
## Expected behavior
The settings migration logic should evaluate target permissions and write the updated `python-envs.terminal.autoActivationType` key directly to the global User Settings.
Extension setting *"Docstring"*:
> **Legacy Setting Support**: This setting takes precedence over the legacy `python.terminal.activateEnvironment` setting.
> **If this setting is not explicitly set and `python.terminal.activateEnvironment` is set to false, this setting will
> automatically be set to `off` to preserve your preference.**
## Actual behavior
The extension migration routine incorrectly targets the local workspace configuration scope rather than the user scope. Because VS Code explicitly bans this particular property from living inside local workspaces for security/stability profiles, it hard-blocks the save execution and triggers the following ERROR:
```log
CodeExpectedError: Unable to write python-envs.terminal.autoActivationType to Workspace Settings.
This setting can be written only into User settings.
```
## Logs
Logs from `Extension Host` output channel:
```log
2026-06-24 21:21:26.780 [error] CodeExpectedError: Unable to write python-envs.terminal.autoActivationType to Workspace Settings. This setting can be written only into User settings.
at M4e.toConfigurationEditingError (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:7060)
at M4e.validate (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:10319)
at M4e.doWriteConfiguration (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:3453)
at Object.factory (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:3309)
at dg.consume (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:434:77539)
at vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:434:77358
at new Promise ()
at dg.queue (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:434:77282)
at M4e.writeConfiguration (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:3278)
at eoi.writeConfigurationValue (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:60043)
at async Promise.all (index 0)
at async Object.a [as settled] (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:434:84659)
at async eoi.updateValue (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:43135)
2026-06-24 21:21:26.780 [error] CodeExpectedError: Unable to write python-envs.terminal.autoActivationType to Workspace Settings. This setting can be written only into User settings.
at M4e.toConfigurationEditingError (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:7060)
at M4e.validate (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:10319)
at M4e.doWriteConfiguration (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:3453)
at Object.factory (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:3309)
at dg.consume (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:434:77539)
at vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:434:77358
at new Promise ()
at dg.queue (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:434:77282)
at M4e.writeConfiguration (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:3278)
at eoi.writeConfigurationValue (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:60043)
at async Promise.all (index 0)
at async Object.a [as settled] (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:434:84659)
at async eoi.updateValue (vscode-file://vscode-app/d:/Program%20Files/VS%20Code/7e7950df89/resources/app/out/vs/workbench/workbench.desktop.main.js:5136:43135)
```
## Additional context
Manual Fix:
The exception loop can be completely stopped by opening the global user configuration and adding the setting manually:
```json
"python-envs.terminal.autoActivationType": "off"
```
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Evaluación
Este issue todavía no se ha evaluado.