From c15ee80b283ad2977e8a8a704dbb2341c0935f29 Mon Sep 17 00:00:00 2001 From: Xin Zhao Date: Sat, 10 Jan 2026 02:48:37 +0800 Subject: [PATCH] languages: Fix Python venv auto-activation for PowerShell 7 (#46465) 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 --- crates/languages/src/python.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/languages/src/python.rs b/crates/languages/src/python.rs index 2ec6bef8f2..81a9971b27 100644 --- a/crates/languages/src/python.rs +++ b/crates/languages/src/python.rs @@ -1462,6 +1462,7 @@ async fn resolve_venv_activation_scripts( (ShellKind::Fish, "activate.fish"), (ShellKind::Nushell, "activate.nu"), (ShellKind::PowerShell, "activate.ps1"), + (ShellKind::Pwsh, "activate.ps1"), (ShellKind::Cmd, "activate.bat"), (ShellKind::Xonsh, "activate.xsh"), ] {