Commit fb80a37
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] <[email protected]>
Co-authored-by: eleanorjboyd <[email protected]>1 parent 4aef1c4 commit fb80a37
File tree
4 files changed
+38
-11
lines changed- src
- managers/common
4 files changed
+38
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
265 | 272 | | |
266 | 273 | | |
267 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
429 | 434 | | |
430 | 435 | | |
431 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
432 | 451 | | |
433 | 452 | | |
434 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | | - | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | 10 | | |
14 | | - | |
15 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments