# languages: Fix Python venv auto-activation for PowerShell 7 \(\#46465\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/442c2364025401f81a8a2d45dea4a8f8c123f1e7)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 442c2364025401f81a8a2d45dea4a8f8c123f1e7

Requested commit: 442c2364025401f81a8a2d45dea4a8f8c123f1e7

Commit: 442c2364025401f81a8a2d45dea4a8f8c123f1e7

Tree: 5abb68151eedc654cf1689cd2b690f6d5f15097c

Author: Xin Zhao

Committer: GitHub

## Message

```
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
```

## Parents

- [1062e2c5a9e9764b58c5c3fdec6a5b9bddd1dd2e](https://git.cafe/gitcafe/zed/commit/1062e2c5a9e9764b58c5c3fdec6a5b9bddd1dd2e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/442c2364025401f81a8a2d45dea4a8f8c123f1e7?format=markdown)
