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
Feature: ability to specify a list of ignored environment variables #401
Comments
Hi @Arkham , have you seen this page yet? https://github.com/direnv/direnv/wiki/Tmux I don't know if adding an exception is a good idea or not. I would like to avoid adding specialized exceptions like that in direnv but if it solves the problem then maybe. Tmux seems to be changing a bunch of environment variables on start which is tricky to deal with from direnv's perspective. I think the issue is really with Tmux but last time I tried digging in the code I got lost. Have a look at the wiki page to see if it can solve your problem. If you get a better understanding of Tmux than I do I am open to add that exception. |
Hey @zimbatm, thanks for getting back to me. Yup, I've seen that page and it was very useful to get tmux to work: the specific issue that I ran into was that tmux uses a special environment variable to track which is the current active pane ($TMUX_PANE) and direnv was interfering with that environment variable because I had ran But in more general terms, I think that there are use cases when the user might want to ignore specific environment variables. By looking at the source of |
I would be open to have that configurable in the config.toml file. Something like |
@Arkham See also restrict direnv load on how you can ignore environment variables with the current direnv implementation. |
Add `[env] / ignore_keys` configuration to ignore the listed environment variables, in addition to the default ones. Fixes direnv#401
Another example of needing an escape hatch: I use zsh as my interactive shell, but prefer bash scripts for portability. I configure |
Hello there, first of all thanks for building direnv!
Recently I was bitten by the fact that direnv controls the environment variables that TMUX uses for bookkeeping. Luckily I was able to get the source and see that we are already ignoring some special environment variables in https://github.com/direnv/direnv/blob/master/env_diff.go so I just had to add
run make and have my setup working again.
Do you think it would be a good idea to be able to pass a list of ignored variables/patterns? Let me know and I can work on building a PR for this.
The text was updated successfully, but these errors were encountered: