-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Environment collection should not be applied on hidden terminals (non-windows) #197187
Comments
@karrtikr it seems like this is actually a bug where the initially hidden terminal doesn't show the applied environments but should? Making a terminal hidden was just meant to be about visibility, not environment? |
I'm fine if we change hidden terminals to also apply environment collection, as long as we get support for #194819. Python extension decided not to send activate commands to hidden terminals: microsoft/vscode-remote-release#1760, as hidden terminals are considered private terminals belonging to a specific extension. One could probably argue similarly for not applying environment collection to such terminals. |
Based on offline discussion we're continue to go with NOT applying environment collection to hidden terminals, due to it affecting remote scenarios. |
We investigated that env collection from shell integration in unix is still being applied on hidden terminals, i.e |
Code to disable for
vscode/src/vs/workbench/contrib/terminal/electron-sandbox/localTerminalBackend.ts Line 376 in 145af9d
Where
|
I cannot reproduce this on Windows or macOS. Steps:
Maybe you had the variable set in the parent environment (main/server?) which is why it showed up? |
Please try it on Linux (codespaces), stated in the original report, this issue doesn't exist on Windows. And I don't have a macOS to verify. |
Checked all causes before applyToProcessEnvironment was used. Fixes #197187
Thanks, missed the remote bit |
As I understand it, hidden terminals were always exempty from shell integration because hidden terminals were thought of as private to an extension in a way, and also since they probably weren't going to be interacted with. Especially since the introduction of the environment variable collection API I think we should change this decision, not doing so will lead to weirdness for extensions where hidden ones (which may be shown later) aren't fully featured and get inconsistent envs. Fixes #199611 Part of #197187
Seems like this behavior has now changed with: #208036. So we should either reopen this one or #194819, to accomplish #194819 (comment). |
I see, suppose if
What does window's environment mean here and will it be applied if |
We don't have any environment to provide, all we want to do is skip applying env collection while the rest of the environment stays as-is, can you guide us on how to exactly use |
@karrtikr basing the environment on |
Gotcha, will try that. I assume shell initialization and integration scripts are still run? |
@karrtikr looking at the code, I think shell integration does activate even when strictEnv is set |
What are some verification steps for this issue? |
@rzhao271 steps at #197187 (comment), remote only |
@Tyriar Actually we reverted the change made in this issue with #197187 (comment), so even hidden terminals have environment collection applied by default now. |
So the steps are:
|
@Tyriar How do I do step 3? Am I opening the terminal-sample workspace after cloning and creating a symlink to it? |
@rzhao271 you can build the extension and do it in the insiders extension development host |
Does this issue occur when all extensions are disabled?: Yes/No
Version: 1.85.0-insider
OS: Linux (codespaces)
WORKS FINE ON WINDOWS
Steps to Reproduce:
(.venv)
in the terminal prompt is contributed via env collection by Python extension.Normal terminal:
Hovering says that collection is applied.
Hidden terminal:
Although it says that no environment collection is contributed upon hovering, collection is still applied as can be seen in the terminal prompt.
The text was updated successfully, but these errors were encountered: