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

direnv: Environment updated. Restart extensions? #161

Open
AlecRust opened this issue Jun 24, 2022 · 12 comments
Open

direnv: Environment updated. Restart extensions? #161

AlecRust opened this issue Jun 24, 2022 · 12 comments

Comments

@AlecRust
Copy link

AlecRust commented Jun 24, 2022

With this extension installed, every time I start vscode, I get this:

image

If I press the "Restart" button, it just pops up again a second later.

I have direnv installed via Homebrew, but I do use asdf-direnv, perhaps that's loading it too fast causing this issue?

Any ideas? Here's my full shell setup.

@mkhl
Copy link
Contributor

mkhl commented Jul 12, 2022

i'm sorry, i have no idea 😔

@mkhl
Copy link
Contributor

mkhl commented Oct 23, 2022

i managed to reproduce something like this, i think by opening a workspace where some variables get unset. will try to fix it now

@mkhl
Copy link
Contributor

mkhl commented Oct 23, 2022

could you check if the extension built in https://github.com/direnv/direnv-vscode/actions/runs/3307828818 helps?

@AlecRust
Copy link
Author

Thanks for looking at this @mkhl. Trouble is this no longer seems as frequent as when I first opened this issue, so I'm struggling to reliably reproduce this on the current extension version. It does still happen though.

Changes in #263 look good regardless though, will you be merging that/cutting a release?

@mkhl
Copy link
Contributor

mkhl commented Oct 28, 2022

Changes in #263 look good regardless though, will you be merging that/cutting a release?

yes absolutely

@codygman
Copy link

I get this error with direnv extension version 0.10.1 and code 1.71.2 on an m1 mac installed from https://code.visualstudio.com/ and the output says:

[2022-11-30 12:50:50.781] [renderer1] [error] A provider has already been registered for scheme file: Error: A provider has already been registered for scheme file
    at k.registerEditSessionIdentityProvider (vscode-file://vscode-app/private/var/folders/_4/2gfm39j97zl8bztn5gzwdjqm0000gr/T/AppTranslocation/1EA2F780-B5E7-4CA1-9607-10A27017CBA7/d/Visual%20Studio%20Code%202.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2766:14678)

@codygman
Copy link

Okay it's not happening anymore after:

  • disabling all extensions
  • restarting code
  • removing .envrc and .direnv
  • starting code and going back to my workspace
  • re-enabling direnv extension
  • calling reset and reload direnv from command palette

I'm not sure which of those things resolved the issue or why, but that's what I did.

@claviola
Copy link

claviola commented Jul 4, 2023

I've been suddenly getting a lot of pop-ups like these on my own install. Is there anything I can look into to see the root cause?

@mkhl
Copy link
Contributor

mkhl commented Jul 10, 2023

There's a direnv output you can look at (the "Output" tab in the bottom panel, then select "direnv" from the dropdown on the right), it logs which variables are getting modified.

@janeklb
Copy link

janeklb commented Mar 21, 2024

There's an option to automatically restart the extension

Direnv > Restart: Automatic
[ ] Automatically restart extension host upon environment changes

that might "fix the problem" (ie. make the dialog stop showing up), but it's got me wondering: why does the extension need to restart when it detects environment changes?

@mkhl
Copy link
Contributor

mkhl commented Mar 21, 2024

why does the extension need to restart when it detects environment changes?

many other extensions use the environment on activation.
restarting the extension host gives us a chance to modify the environment before they use it.

@janeklb
Copy link

janeklb commented Mar 21, 2024

oh -- this is referring to restarting the VSCode extension host (not the direnv extension itself). that makes a lot more sense 🙇🏻 thanks!

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

No branches or pull requests

5 participants