Skip to content

Conversation

@karthiknadig
Copy link
Member

@karthiknadig karthiknadig commented Apr 10, 2025

fixes #282

@karthiknadig karthiknadig self-assigned this Apr 10, 2025
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Apr 10, 2025
@karthiknadig karthiknadig requested a review from Copilot April 11, 2025 00:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to fix the casing used in activation scripts for Conda environments by standardizing the way activation commands are constructed. Key changes include:

  • Splitting the creation of Conda environment info into two functions: getNamedCondaPythonInfo and getPrefixesCondaPythonInfo.
  • Updating command arguments for gitbash shell activation to use the provided environment name.
  • Simplifying and updating shell activation handling in the built-in venv utilities and shell detection.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/managers/conda/condaUtils.ts Refactors environment info creation and updates activation args.
src/managers/builtin/venvUtils.ts Simplifies shell command resolution based on available activation files.
src/features/common/shellDetector.ts Normalizes shell names to lowercase for consistency.
Comments suppressed due to low confidence (2)

src/features/common/shellDetector.ts:142

  • Forcing the shell value to lowercase here may affect downstream consumers expecting the original casing. Please verify that all parts of the system accept lowercase shell names.
if (terminal.state.shell && known.includes(terminal.state.shell.toLowerCase())) {

src/managers/conda/condaUtils.ts:342

  • The base environment branch now calls getNamedCondaPythonInfo without logging the discovery of a base environment. If this logging is important for debugging, consider reintroducing a log statement.
if (e.name === 'base') {
@karthiknadig karthiknadig marked this pull request as ready for review April 11, 2025 00:20
@karthiknadig karthiknadig enabled auto-merge (squash) April 11, 2025 00:20
@vs-code-engineering
Copy link

⚠️ This PR originates from a fork. Due to security restrictions, pipelines from forks are no longer triggered automatically. Learn more.

If the changes appear safe, you can manually trigger the pipeline by commenting /AzurePipelines run.

@vs-code-engineering vs-code-engineering bot added this to the April 2025 milestone Apr 11, 2025
@karthiknadig karthiknadig merged commit f662c0b into microsoft:main Apr 11, 2025
6 checks passed
@karthiknadig karthiknadig deleted the fix-activate-script branch April 11, 2025 00:37
NguyenCuong1989 referenced this pull request in NguyenCuong1989/vscode-python-environments Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

2 participants