Skip to content

Spike: Investigate approach to use environment variables for environment activation #20492

Closed
@karrtikr

Description

@karrtikr

For #11039

Getting activated environment variables from conda

Get activated environment variables for each shell.

  • Variables for each shell might be different. For eg. the prompt variable.
  • Shell path to conda for each shell might be different. For eg. cmd might be conda init already but powershell might not be.

Diff is another option. Can we use diff for cmd in powershell, and add the prompt variable ourselves?

Use environment variable collection to activate terminals

Blockers: microsoft/vscode#99878 on macOS

  • Handling the debugger python config scenario
    • Which one takes precedence: environment var collection or env vars run in terminal request or envs supplied when creating terminal
    • Kind of like internal console, except for rc and profile scripts?
    • createTerminal(env) overrides environment variable collection and env in runinterminal request also affects the terminal.
  • Cleanup collection prompt
    image
    Also there are some meaningless changes: like true to 1.
    Instead of this would it make more sense to user to just say: Terminal needed to be restarted to apply results of <conda command>: Allow to provide description to environment collection API vscode#171108
    Some other alternatives:
    • Title of environment variable collection to shown the first time.
    • Either in the prompt UI or when terminal starts up.
      image

What about multiroot workspaces?

Environment variable collection for a workspace?

Clarify what:

Note that an extension can only make a single change to any one variable, so this will overwrite any previous calls to replace, append or prepend.

means.

Relaunch terminal doesn't show up always.

on did change default shell event? microsoft/vscode#160694 (comment)
onDidOpenTerminal and vscode.env.shell: microsoft/vscode#171164

Metadata

Metadata

Assignees

Labels

area-debuggingarea-environmentsFeatures relating to handling interpreter environmentsarea-terminalfeature-requestRequest for new features or functionalityneeds spikeLabel for issues that need investigation before they can be worked on.verifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions