Skip to content

Terminal: Auto-activation command injected before shell prompt initializes #1312

@koolcandy

Description

@koolcandy

When opening a new integrated terminal in a workspace with a Python virtual environment (created by uv), the Python extension injects the activation command (source .../activate.fish) into the PTY buffer too early.

It happens before the Fish shell and the Starship prompt have fully initialized. This causes the activation command to be printed to the screen without a command prompt, leading to a messy, confusing visual experience, and sometimes causing duplicate prompt renderings.
Steps to Reproduce

  • Create a Python virtual environment in a workspace using uv (e.g., uv venv).

  • Open the workspace in VS Code.

  • Open a new Integrated Terminal.

Image

Expected behavior

The Python extension should wait for the shell integration/prompt to fully load before injecting the command, OR ideally, use the Environment Variable Collection to activate the uv environment silently in the background without injecting raw text into the terminal.
Actual behavior

The source /path/to/.venv/bin/activate.fish command is injected blindly into the stdin buffer. The terminal echoes this command before the Starship prompt has time to render, making it look like a broken shell state.
Environment data

  • VS Code version: 1.109.5

  • Python Extension version: 2026.2.0

  • OS: macOS Tahoe 26.3 (arm64, Apple M1 Pro)

  • Shell: fish 4.5.0

  • Prompt: Starship

  • Python Env Manager: uv

Metadata

Metadata

Assignees

Labels

area-activationIssue related to activation. Root cause can be from interpreter selection or activation in terminalarea-terminalEnvironment extension specific terminal issues.info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions