Skip to content

Bug: Debugger on Linux launches Python run/activatedRun command before the activation/shellActivation command from PythonEnvironmentExecutionInfo #934

@symzn

Description

@symzn

Hello,
I am developing a VS Code extension that provides micromamba environments by implementing the EnvironmentManager API.
I've identified a critical execution order issue when launching the debugger on Linux (bash interpreter).
Extension source code:
https://github.com/symzn/vscode-micromamba-env

The Problem:
When starting a debug session on Linux (using bash), the Python run/activatedRun command is launched before the activation/shellActivation command (class PythonEnvironmentExecutionInfo).
In most cases this is not a problem as the full python executable path is given (and thus the corresponding sites-packages is correctly found) but when external components or environment variables activation are required it is a problem.

After the debug session terminates, the integrated terminal is left in the correctly activated state. This proves that the activation command itself is correct, but it is executed too late in the sequence.

This issue does not occur on Windows with PowerShell, where the execution order is correct: the activation command completes first, and then the Python debugger is launched. This suggests the problem is specific to the command handling for the debugger on Linux.

Expected Behavior:
The command provided in the activation/shellActivation property should be executed and allowed to complete before the Python debugger process is launched.

Thank you for your work and for looking into this critical issue.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugtriage-needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions