There are two problems.
The first one:
create .envrc with export MYVAR=45M-x envrc-allowM-x getenv MYVAR => 45
After that remove or rename MYVARM-x envrc-allowM-x getenv MYVAR => 45
But I expected that MYVAR is gone from my environment.
Another problem is excessive calls to direnv export.
Call envrc-reload multiple times.
Create a file temp in the same directory.
change .envrc e.g. add export MYVAR_2=56 and reload M-x envrc-allow
You can see in *Messages* multiple lines like this
Running direnv in /tmp/tempdir/...
Direnv succeeded in /tmp/tempdir/
Running direnv in /tmp/tempdir/...
Direnv succeeded in /tmp/tempdir/
Why is it called multiple times? You can print cache keys for each buffer and see multiple MYVAR and MYVAR_2 for .envrc buffer and only MYVAR_2 for new buffer.
in envrc--update
There are two problems. The first one: create .envrc with
export MYVAR=45
M-x envrc-allow
M-x getenv MYVAR => 45
After that remove or renameMYVAR
M-x envrc-allow
M-x getenv MYVAR => 45
But I expected thatMYVAR
is gone from my environment. Another problem is excessive calls todirenv export
. Callenvrc-reload
multiple times. Create a filetemp
in the same directory. change .envrc e.g. addexport MYVAR_2=56
and reloadM-x envrc-allow
You can see in*Messages*
multiple lines like thisWhy is it called multiple times? You can print cache keys for each buffer and see multiple MYVAR and MYVAR_2 for .envrc buffer and only MYVAR_2 for new buffer. in
envrc--update