diff --git a/dot-config/zsh/interactive/direnv b/dot-config/zsh/interactive/direnv index ba862dc..49e16f6 100644 --- a/dot-config/zsh/interactive/direnv +++ b/dot-config/zsh/interactive/direnv @@ -1,12 +1,8 @@ #! zsh _direnv_hook() { - trap -- '' SIGINT - emulate zsh -c "$(direnv export zsh)" - trap - SIGINT + eval "$(direnv export zsh)" } - -typeset -ag precmd_functions chpwd_functions -if (( $+commands[direnv] )); then - [[ -z ${precmd_functions[(r)_direnv_hook]} ]] && precmd_functions+=(_direnv_hook) - [[ -z ${chpwd_functions[(r)_direnv_hook]} ]] && chpwd_functions+=(_direnv_hook) +typeset -ag precmd_functions +if (( $+commands[direnv] )) && [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then + precmd_functions+=(_direnv_hook) fi diff --git a/dot-config/zsh/zshrc b/dot-config/zsh/zshrc index 70ce6e4..c374637 100644 --- a/dot-config/zsh/zshrc +++ b/dot-config/zsh/zshrc @@ -1,7 +1,3 @@ -# For accurate instant prompt from Powerlevel10k, we need to load up the -# correct environment from direnv first. -(( ${+commands[direnv]} )) && emulate zsh -c "$(direnv export zsh)" - # Enable Powerlevel10k instant prompt. Should stay close to the top of zshrc. # Initialization code that may require console input (password prompts, [y/n] # confirmations, etc.) must go above this block; everything else may go below.