-
Notifications
You must be signed in to change notification settings - Fork 12
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
Stale environment for integrated terminal #470
Comments
The direnv extension keeps a cache of the modified environment in the workspace state, that's the SQLite file you found. It's there to speed up the initial load and hopefully get the environment in place before other extensions try to use it, and has caused your issue. What is weird is that you state the environment was only present in integrated terminals, which to me would imply that it was not present in other tasks, and the two managed environments had gotten out of sync. Is that what you meant?
This is leaning very heavily on assumptions and the word properly… That said, I agree that matching your intuition would be valuable, i.e. if this extension worked more like a shell that starts from a well-known environment and only loads changes to it from known sources.
I'd be very curious what you expected to find there, or how often you've managed to find something valuable there already? I believe that files there would be generated by a |
Sorry, should have been more clear here. I meant my terminal outside of VS Code (Alacritty). I couldn't
What I mean here is if I add an env var to
If it's not a bug, how is this supposed to work? The user needs to be aware of when the env changes and manually run
Looking for the
|
Like I said, if a variable needs to be unset then one should unset it. Also like I said: What you're expecting would be obviously strictly better.
Oh all outputs get persisted there, nice. TIL, thank you! |
I was having a problem where
direnv
failed loading the Nix shell due to an invalidNODE_OPTIONS
flag, but only in the VS Code integrated terminal. Outside of VS Codedirenv
had no issue loading andNODE_OPTIONS
was unset. I wasn't settingNODE_OPTIONS
anywhere, such as.envrc
or.env
. Eventually I found reference toNODE_OPTIONS
in~/.config/Code/User/workspaceStorage/33633d8607204d6980a785c25990590d/state.vscdb.backup
. It's an SQLite DB, and in theItemTable
table there's a row with keyterminal.integrated.environmentVariableCollections
where the value is a JSON blob and that shows the environment variable is frommkhl.direnv
. Knowing that, I randirenv: Reset and reload environment
, which got rid of theNODE_OPTIONS
environment variable.It seems like somehow the direnv VS Code extension isn't properly updating the direnv environment in the integrated terminal. I had set that environment variable like 3 weeks ago to test something and then remove it and I've definitely rebooted my computer, reloaded VS Code, exited VS Code, exited the integrated terminal (typing
exit
to clear history), etc. I assumed re-opening VS Code would reload the environment properly.What's interesting is that I find no logging of the direnv extension setting
NODE_OPTIONS
in the VS Code logs.rg --no-ignore NODE_OPTIONS -l ~/.config/Code/logs
returns zerodirenv
results.The text was updated successfully, but these errors were encountered: