You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add command to run Python Environment Tool (PET) in terminal (#608)
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] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
0 commit comments