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

File changes often ignored #9

Open
mcandre opened this issue Sep 1, 2021 · 2 comments
Open

File changes often ignored #9

mcandre opened this issue Sep 1, 2021 · 2 comments

Comments

@mcandre
Copy link

mcandre commented Sep 1, 2021

Hi,

posh-direnv often silently fails to apply .psenvrc changes. I go through the Edit-DirEnvRc workflow, and even close and relaunch PowerShell. But still, the changes fail to take effect.

As a workaround, I have to repeat the same Edit-DirEnvRc steps over and over. Sometimes I add a dummy blank line, save, then delete the line, resave, and quit notepad.

I suspect the root cause has to do with posh-direnv's overly aggressive requirement for the file contents to be detected to change. In other words, we can improve posh-direnv accuracy by dropping the code that performs difference checks. Just always approve and apply the latest .psenvrc contents on disk, when notepad exits without an error status code.

Update

Even with NO changes to the .psenvrc file, posh-direnv often fails to load the configuration into the PowerShell environment. I very often have to manually execute Edit-DirEnvRc, add a blank line, save, delete the blank line, save, and quit notepad. In order for the existing .psenvrc contents take effect.

@macksal
Copy link

macksal commented Jul 1, 2023

I understand the need to avoid arbitrary code execution, but it would be good to have the ability to mark a particular directory as "trusted" so that any future changes would be approved automatically and run directly from the file.

@mcandre
Copy link
Author

mcandre commented Aug 8, 2023

direnv does this with direnv allow, and has no issue with silently ignoring file changes. Also, direnv loudly complains when there is an untrusted configuration file in the search path.

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

No branches or pull requests

2 participants