Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 15, 2025

This PR adds a new command that allows users to run the Python Environment Tool (PET) binary in a terminal to search for Python installations interactively.

Changes Made

Command Registration

  • Added python-envs.runPetInTerminal command to package.json
  • Added localized title "Run Python Environment Tool (PET) in Terminal" to package.nls.json
  • Command is categorized under "Python" and only shown when the environments extension is enabled

Implementation

  • Exported getNativePythonToolsPath() function from nativePythonFinder.ts
  • Added command handler in extension.ts that:
    • Gets the PET executable path using getNativePythonToolsPath()
    • Creates a new terminal named "Python Environment Tool (PET)"
    • Executes the PET binary in the terminal with proper path quoting
    • Shows the terminal to the user immediately
    • Includes comprehensive error handling with user-friendly messages

Usage

Users can now:

  1. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Search for "Run Python Environment Tool (PET) in Terminal"
  3. Execute the command to open a terminal running PET
  4. Interactively explore and search for Python installations

The implementation follows existing codebase patterns for terminal commands and maintains consistency with other extension features.

Fixes #607.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Feature: Add command to run PET in terminal Add command to run Python Environment Tool (PET) in terminal Jul 15, 2025
Copilot AI requested a review from eleanorjboyd July 15, 2025 16:12
Copilot finished work on behalf of eleanorjboyd July 15, 2025 16:12
@eleanorjboyd eleanorjboyd marked this pull request as ready for review July 15, 2025 17:13
@vs-code-engineering vs-code-engineering bot added this to the July 2025 milestone Jul 15, 2025
@eleanorjboyd eleanorjboyd merged commit fb80a37 into main Jul 15, 2025
10 checks passed
@eleanorjboyd eleanorjboyd deleted the copilot/fix-607 branch July 15, 2025 18:06
NguyenCuong1989 referenced this pull request in NguyenCuong1989/vscode-python-environments Oct 23, 2025
This PR adds a new command that allows users to run the Python
Environment Tool (PET) binary in a terminal to search for Python
installations interactively.

## Changes Made

### Command Registration
- Added `python-envs.runPetInTerminal` command to `package.json`
- Added localized title "Run Python Environment Tool (PET) in Terminal"
to `package.nls.json`
- Command is categorized under "Python" and only shown when the
environments extension is enabled

### Implementation
- Exported `getNativePythonToolsPath()` function from
`nativePythonFinder.ts`
- Added command handler in `extension.ts` that:
  - Gets the PET executable path using `getNativePythonToolsPath()`
  - Creates a new terminal named "Python Environment Tool (PET)"
  - Executes the PET binary in the terminal with proper path quoting
  - Shows the terminal to the user immediately
  - Includes comprehensive error handling with user-friendly messages

### Usage
Users can now:
1. Open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`)
2. Search for "Run Python Environment Tool (PET) in Terminal"
3. Execute the command to open a terminal running PET
4. Interactively explore and search for Python installations

The implementation follows existing codebase patterns for terminal
commands and maintains consistency with other extension features.

Fixes #607.

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent) to
start the survey.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: eleanorjboyd <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add command to run PET in terminal

3 participants