From 95ac7bd9dec05d695c239ba6750bfa71e93825e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Mon, 5 Oct 2026 09:53:25 +0200 Subject: [PATCH] fix(zsh): completion unloading direnv --- zsh/.zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zsh/.zshrc b/zsh/.zshrc index ef94c73..06005c8 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -96,6 +96,9 @@ zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' eval "$(ggman shellrc)" eval "$(starship init zsh)" eval "$(direnv hook zsh)" +# skip direnv in subshells; completion functions cd inside $(...) and trip chpwd +_direnv_hook_toplevel() { (( ZSH_SUBSHELL )) || _direnv_hook } +chpwd_functions=(${(u)chpwd_functions/#%_direnv_hook/_direnv_hook_toplevel}) # gnupg export GPG_TTY=$(tty)