Skip to content

Choose project for terminal#1401

Open
edvilme wants to merge 2 commits intomainfrom
multiroot-terminal
Open

Choose project for terminal#1401
edvilme wants to merge 2 commits intomainfrom
multiroot-terminal

Conversation

@edvilme
Copy link
Copy Markdown
Contributor

@edvilme edvilme commented Mar 26, 2026

Fixes #291

image

This pull request updates the logic for creating terminal commands related to Python environments, focusing on how Python projects are retrieved and passed to the pickProject function. The changes improve consistency and clarity in how project lists are handled.

Improvements to project selection logic:

  • The list of Python projects is now retrieved once and reused in both the undefined context and tree item context branches, ensuring consistency and avoiding redundant API calls. [1] [2]
  • The condition for prompting the user to pick a project has been updated to check if the list of Python projects is non-empty, which prevents unnecessary prompts when there are no projects available.

@edvilme edvilme added area-terminal Environment extension specific terminal issues. bug Issue identified by VS Code Team member as probable bug labels Mar 26, 2026
@edvilme edvilme requested review from Copilot and eleanorjboyd March 26, 2026 05:16
Copy link
Copy Markdown
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

Adjusts the Python: Create Terminal command behavior to better support multi-root workspaces by selecting an appropriate Python project before creating a terminal.

Changes:

  • Cache api.getPythonProjects() and reuse it during terminal creation.
  • Update the project-picking flow in createTerminalCommand.
  • Update package-lock.json with additional peer metadata entries.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/features/envCommands.ts Updates project selection logic used when creating terminals.
package-lock.json Adds peer: true metadata to multiple dependency entries.

@edvilme edvilme marked this pull request as ready for review March 27, 2026 20:50
"integrity": "sha512-D7DbgGFtsqIPIFMPJwCad9Gfi/hC0PWErRRHFnaCWoEDYi5tQUDiJCTmGUbBiLzjqAck4KcXt9Ayj0CNlIrF+w==",
"dev": true,
"license": "BSD-2-Clause",
"peer": true,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

any idea why this had changes to the package lock file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-terminal Environment extension specific terminal issues. bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Python: Create Terminal' doesn't consider multiroot option

3 participants