Compare commits
2 commits
17359d1fd0
...
1bc2b49e3f
Author | SHA1 | Date | |
---|---|---|---|
1bc2b49e3f | |||
60f637b609 |
2 changed files with 12 additions and 4 deletions
|
@ -1,8 +1,12 @@
|
||||||
#! zsh
|
#! zsh
|
||||||
_direnv_hook() {
|
_direnv_hook() {
|
||||||
eval "$(direnv export zsh)"
|
trap -- '' SIGINT
|
||||||
|
emulate zsh -c "$(direnv export zsh)"
|
||||||
|
trap - SIGINT
|
||||||
}
|
}
|
||||||
typeset -ag precmd_functions
|
|
||||||
if (( $+commands[direnv] )) && [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then
|
typeset -ag precmd_functions chpwd_functions
|
||||||
precmd_functions+=(_direnv_hook)
|
if (( $+commands[direnv] )); then
|
||||||
|
[[ -z ${precmd_functions[(r)_direnv_hook]} ]] && precmd_functions+=(_direnv_hook)
|
||||||
|
[[ -z ${chpwd_functions[(r)_direnv_hook]} ]] && chpwd_functions+=(_direnv_hook)
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
# 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.
|
# Enable Powerlevel10k instant prompt. Should stay close to the top of zshrc.
|
||||||
# Initialization code that may require console input (password prompts, [y/n]
|
# Initialization code that may require console input (password prompts, [y/n]
|
||||||
# confirmations, etc.) must go above this block; everything else may go below.
|
# confirmations, etc.) must go above this block; everything else may go below.
|
||||||
|
|
Loading…
Reference in a new issue