direnv.plugin.zsh 378 B

12345678910111213
  1. _direnv_hook() {
  2. trap -- '' SIGINT;
  3. eval "$(direnv export zsh)";
  4. trap - SIGINT;
  5. }
  6. typeset -ag precmd_functions;
  7. if [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then
  8. precmd_functions=( _direnv_hook ${precmd_functions[@]} )
  9. fi
  10. typeset -ag chpwd_functions;
  11. if [[ -z ${chpwd_functions[(r)_direnv_hook]} ]]; then
  12. chpwd_functions=( _direnv_hook ${chpwd_functions[@]} )
  13. fi