Reputation: 702
I have direnv
installed, and I was wondering if there was a way of stopping it from showing all of the environment variables it loads? The output lines it currently shows are:
direnv: loading .envrc
direnv: export +FOO +BAR +FOO2 +BAR2 +FOO3 +BAR3 +FOO4 +BAR4
I'm fine with having the first line show, but since my second line has something like 50 variables in it, it's slightly annoying to have the lot of them shown every time I go into the directory.
Upvotes: 5
Views: 3206
Reputation: 11
Somewhat late to the party but in version 2.35.0 (when I started using direnv), that functionality can be configured. Create a file .config/direnv/direnv.toml
and add the line:
hide_env_diff = true
You can find this and other direnv configuration with man direnv.toml
.
Upvotes: 1
Reputation: 812
It's possible to remove the logs entirely by setting export DIRENV_LOG_FORMAT=
but then the rest of the logs are also missing
Upvotes: 5
Reputation: 7483
As far as I know, you cannot change that behavior through configuration.
If that behavior was part of the stdlib, you could override it. In fact, the first ouput, direnv: loading .envrc
comes from source_env
which uses log_status
to output to stderr, so you could override either of source_env
or log_status
in ~/.config/direnv/.direnvrc
or ~/.direnvrc
.
However, the second output is coming from diffString in cmd_export.go
(via log_status
in log.go
). Short of compiling your own, modified version of direnv, I don't see how you can change that behavior as of the current release (v2.17.0).
Upvotes: 0