Skip to content
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

newly created VS Code instances do not always see .bashrc changes (linux) #111650

Closed
weinand opened this issue Dec 1, 2020 · 1 comment
Closed
Assignees
Labels
info-needed Issue requires more information from poster under-discussion Issue is under discussion for relevance, priority, approach workbench-os-integration Native OS integration issues

Comments

@weinand
Copy link
Contributor

weinand commented Dec 1, 2020

Testing #111422

Initial scenario: "install some new SW that extends the path in .bashrc":

  • in a linux terminal open ".bashrc" and add "export FOO=BAR" at the end and save.
  • in the same terminal run "echo $FOO" and observe that it is not defined (which is expected)
  • in the same terminal run "code-insiders ." and observe in dev tools that FOO is not defined (which is surprising. Is this a bug?)
  • in that VS Code instance open VS Code's integrated terminal and run "echo $FOO" which shows that FOO is defined (good!)

Typically this will confuse users: an extension depending on the env var will fail, but the env var in the integrated terminal shows it correctly.


Next scenario: "in another terminal or VS Code window everything is consistent and works fine":

  • open another linux terminal and verify by running "echo $FOO" that FOO is now defined (which is expected)
  • in the same terminal run "code-insiders ." and observe in dev tools that FOO is defined (which is expected)
  • in that VS Code instance open VS Code's integrated terminal and run "echo $FOO" which shows that FOO is defined (good!)

User is happy!


Problematic scenario: "launch VS Code from dock and things stop working...":

  • from the dock open another VS Code instance and observe that env var FOO is not defined in dev tools but it is defined in an integrated terminal (this is a bug, right?)

Again, this will confuse user.

@weinand weinand changed the title newly created VS Code instances do not see .bashrc changes (linux) newly created VS Code instances do not always see .bashrc changes (linux) Dec 1, 2020
@bpasero bpasero added this to the November 2020 milestone Dec 1, 2020
@bpasero bpasero added the workbench-os-integration Native OS integration issues label Dec 1, 2020
@bpasero
Copy link
Member

bpasero commented Dec 2, 2020

Scenario 1: what you see is expected. when you run VSCode from the terminal, we will not resolve the shell environment on startup but take everything we have from the moment you start. Since .bashrc was edited without restarting the terminal, you do not see your new variable defined. However, terminals inside VSCode are always sourced from .bashrc on opening so you may end up with different environment from the launch of VSCode compared to the integrated terminal. But I think that is a consistent experience because inside VSCode you actually start a new terminal session, so .bashrc should be read and used.

Scenario 3: it sounds to me that the shell environment is not resolved at all in certain cases for you and I think we can move that discussion into https://github.com/microsoft/vscode/issues/111603 which seems related. See https://github.com/microsoft/vscode/issues/111603#issuecomment-737049487

@bpasero bpasero added info-needed Issue requires more information from poster under-discussion Issue is under discussion for relevance, priority, approach labels Dec 2, 2020
@bpasero bpasero removed this from the November 2020 milestone Dec 3, 2020
@bpasero bpasero closed this as completed Dec 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster under-discussion Issue is under discussion for relevance, priority, approach workbench-os-integration Native OS integration issues
Projects
None yet
Development

No branches or pull requests

2 participants