microsoft / microsoft/vscode-python-environments

`python-envs.terminal.autoActivationType` migration script incorrectly targets Workspace settings instead of User settings

Aberta
#1,608 0 comentários 1 reação 2 responsáveis Ver no GitHub

@StellaHuang95 já está trabalhando nisso.

Desde 24/6/2026.

Linguagem predominante
TypeScript
Estrelas
138
Forks
62
Merge médio
1d 4h
PRs com merge (30d)
35

Descrição

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:

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:

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 (<anonymous>)
    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 (<anonymous>)
    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:

"python-envs.terminal.autoActivationType": "off"

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.