Skip to content

languages: Fix Python venv auto-activation for PowerShell 7#46465

Merged
Veykril merged 1 commit intozed-industries:mainfrom
lingyaochu:powershell_venv
Jan 9, 2026
Merged

languages: Fix Python venv auto-activation for PowerShell 7#46465
Veykril merged 1 commit intozed-industries:mainfrom
lingyaochu:powershell_venv

Conversation

@lingyaochu
Copy link
Contributor

Summary
This PR fixes an issue where Python virtual environments (venv, uv, etc.) were not automatically activated when opening a terminal using PowerShell 7.

Details
ShellKind distinguishes between the legacy Windows PowerShell (ShellKind::PowerShell) and the newer PowerShell 7 (ShellKind::Pwsh). Previously, the logic in resolve_venv_activation_scripts only checked for ShellKind::PowerShell, causing activate.ps1 resolution to fail for Pwsh users.
This change adds ShellKind::Pwsh to the resolution list, mapping it to activate.ps1 just like the legacy PowerShell.

Release Notes:

  • Fixed Python virtual environments not automatically activating in PowerShell 7

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 9, 2026
@maxdeviant maxdeviant changed the title language: fix python venv auto-activation for PowerShell 7 languages: Fix Python venv auto-activation for PowerShell 7 Jan 9, 2026
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril enabled auto-merge (squash) January 9, 2026 18:37
@Veykril Veykril merged commit 442c236 into zed-industries:main Jan 9, 2026
26 checks passed
@lingyaochu lingyaochu deleted the powershell_venv branch January 10, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants