fix(fnm): load managed Node from always-on zsh layer

fnm lived in interactive-only ~/.config/zshrc, so ssh/agents/zsh -c
missed fnm-managed node. Source ~/.config/zsh/*.zsh from .zshenv and
install the fragment as zsh/fnm instead.
This commit is contained in:
Jeffrey
2026-08-07 14:08:07 +08:00
parent 7a43940317
commit 42c8305871
6 changed files with 104 additions and 30 deletions
+11 -2
View File
@@ -18,7 +18,16 @@ if [[ -d "$HOME/.local/bin" ]]; then
export PATH
fi
if [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/local.zsh" ]]; then
# Always-on tool fragments (~/.config/zsh/*.zsh). local.zsh is sourced last so it wins.
ZSH_ALWAYS_ON_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
if [[ -d "$ZSH_ALWAYS_ON_DIR" ]]; then
for f in "$ZSH_ALWAYS_ON_DIR"/*.zsh(N); do
[[ ${f:t} == local.zsh ]] && continue
# shellcheck disable=SC1090
. "$f"
done
fi
if [[ -f "$ZSH_ALWAYS_ON_DIR/local.zsh" ]]; then
# shellcheck disable=SC1090
. "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/local.zsh"
. "$ZSH_ALWAYS_ON_DIR/local.zsh"
fi