-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spike: Investigate approach to use environment variables for environment activation #20492
Comments
Multiroot scenarios:Each workspace can have a different environment selected. How to decide which one applies to the collection? Options:
Potential requests from VSCode:In the second case, if To make the first case work would require a more convoluted solution from VSCode, for eg. environment collection only applies to a particular workspace. For simplicity it would also work if we could disable prompts altogether in multiroot workspaces: |
@karrtikr am I understanding this right that the environment variable collection is applied to the workspace, not the individual folder in the workspace? Would allowing to apply a particular workspace to the The idea of |
Yes
I assume you also mean existing APIs like |
Fish shell scenario:Fish shell does not have a prompt variable which we could set like cmd to indicate which environment is active: Potential requests from VSCode:
|
The trick would be coming up with a way to do it in a backwards compatible way so we don't break the API. Haven't thought about it too much but for example: export interface EnvironmentVariableMutator {
readonly type: EnvironmentVariableMutatorType;
readonly value: string;
readonly workspace: Workspace | undefined;
}
export interface EnvironmentVariableCollection extends Iterable<[variable: string, mutator: EnvironmentVariableMutator]> {
replace(variable: string, value: string, workspace?: Workspace): void;
append(variable: string, value: string, workspace?: Workspace): void;
prepend(variable: string, value: string, workspace?: Workspace): void;
} Tracked in microsoft/vscode#171173 |
What if we allowed an extension to control a variable that is fed into both the title and description settings? Tracked in microsoft/vscode#171175 |
Created action item based on spike: #20822 |
For #11039
Getting activated environment variables from conda
Get activated environment variables for each shell.
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
python
config scenarioAlso there are some meaningless changes: like
true
to1
.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#171108Some other alternatives:
What about multiroot workspaces?
Environment variable collection for a workspace?
Clarify what:
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#171164python.terminal.activateinterminl
settings if we aren't sending commands.vscode.env.shell
might return empty string to extension if fetched very soon after startup vscode#160694 (comment)onDidChangeShell
event which is fired when default terminal profile changes vscode#171164 (comment)The text was updated successfully, but these errors were encountered: