Skip to content

VS Code Pixi env selection passes decorated label to --environment, causing parse failure #50

Open

Description

@harrisoncbrammell

Summary

Selecting a Pixi environment in VS Code fails because the extension passes a decorated display label (including :default and Python version) into the CLI --environment argument, instead of the raw Pixi environment name.

Reproducible error

From Pixi Code output (repeated on 2026-09-08):

Failed to run "pixi list --no-install --frozen --json --environment "compneuro:default (3.12.14)""

Error: Cannot resolve tree item for element 0/0:compneuro/0:Python 3.14 (64-bit) from extension ms-python.vscode-python-envs

Expected behavior

The extension should pass only the canonical env name (e.g., compneuro) to --environment.

Actual behavior

The extension appears to pass a UI label string:

  • compneuro (env name)
    
  • :default (marker)
    
  • (3.12.14) (version metadata)
    

So CLI receives: --environment "compneuro:default (3.12.14)" which Pixi rejects.

Additional correlated errors

At the same time, VS Code logs repeatedly show:

'Error: Cannot resolve tree item for element 0/0:compneuro/0:Python 3.14 (64-bit) from extension ms-python.vscode-python-envs'

This may indicate environment-label handling/parsing issues across the env provider/selector boundary.

Steps to reproduce

  1. Open workspace with Pixi env compneuro.
  2. In VS Code, select the Pixi env from interpreter/environment picker.
  3. Observe invocation of: pixi list --no-install --frozen --json --environment "compneuro:default (3.12.14)"
  4. Command fails with environment-name parse error.

Environment

OS: Windows 11 x64 (Windows_NT 10.0.26200)
VS Code: 1.136.2
Commit 88e44fa0e00b08f7758b4f6d05632e4fd5e4df6f
Date 2026-09-04T21:40:42Z
Pixi Code extension: 0.2.0
Pixi CLI: 0.79.0
Python env extension: ms-python.vscode-python-envs 1.36.0
Pylance: 2026.3.1
Workspace trust state: saw Cannot launch a terminal process in an untrusted workspace (possibly relevant)

Possible root cause

A display label is being used directly as the CLI identifier without normalization/mapping to canonical Pixi env name.

Suggested fix

Keep display metadata for UI only, and pass canonical env name to CLI calls.

Related issue

Potentially related: #13
#13

Activity

  1. dakoop commented on Sep 14, 2026

    @dakoop

    Duplicate of #47. I added a #48 as an attempt to fix this, but you have to compile and install the extension yourself as this extension's development seems to be inactive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions