Why is direnv failing to read my zsh/fish/elvish/tcsh script?

1.1k Views Asked by At

When attempting to evaluate a .envrc file I get the error "emulate: command not found" or "cd: -q: invalid option" or any number of various possible errors in my completely valid zsh/fish/elivsh/tcsh script.

1

There are 1 best solutions below

0
On BEST ANSWER

direnv uses only bash to evaluate your .envrc file. It then exports the changes back to your original shell. You'll have to rewrite your .envrc in bash.

Also check out direnv stdlib for the utility functions that direnv gives you access to from within any .envrc file.