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

Request: workspace setting to automatically reload .envrc whenever it changes #601

Open
alexwforsythe opened this issue Sep 5, 2023 · 2 comments

Comments

@alexwforsythe
Copy link

alexwforsythe commented Sep 5, 2023

Actual behavior

Whenever I make a change to my workspace root's .envrc file and save it, I get this notification:

image

direnv: Your .envrc has changed. Would you like to allow it?

I can then click Allow or run direnv: allow the .envrc from the command palette to reload it.

Requested behavior

The README states:

When any files watches by direnv are modified the extension automatically reloads the environment.

It would be really convenient if, when I change the .envrc file, the extension automatically runs direnv: allow the .envrc for me instead of displaying the notification in the screenshot.

I can imagine that not all users want this behavior in every workspace, so this should be an optional setting that's disabled by default.

@mkhl
Copy link
Contributor

mkhl commented Sep 12, 2023

I figured someone would ask for this, I'll look into it :)

@alexwforsythe
Copy link
Author

Thanks! Since posting this issue, I've discovered we can use the direnv whitelist setting to achieve auto-allow behavior in the shell. I'm not sure if it works with other non-shell tasks in VSCode, but if so, maybe we could just disable the notification for whitelisted .envrc files.

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

2 participants