fix(zshenv): put ~/.local/bin on PATH for every zsh

Non-interactive agent shells (Codex, Claude) skip .zshrc and never saw
user-local tools installed via pipx/uv/grok. Add ~/.local/bin in
.zshenv with an idempotent guard, and source optional
~/.config/zshenv.local for machine-local early env.
This commit is contained in:
Jeffrey
2026-08-06 14:25:52 +08:00
parent 6f6a8ac5f8
commit ed5365859c
4 changed files with 33 additions and 7 deletions
+3 -2
View File
@@ -19,10 +19,11 @@ and `~/.zshenv` before replacing them.
| Path | Role |
| --- | --- |
| `~/.zshrc` | Canonical shell entry (from repo `.zshrc`). Stay close to upstream; reinstall overwrites it. |
| `~/.zshenv` | Early env for every zsh (Homebrew `shellenv` on macOS). |
| `~/.zshenv` | Early env for every zsh: Homebrew `shellenv` on macOS, plus `~/.local/bin` on PATH. |
| `~/.config/zshenv.local` | Optional machine-local early env (cargo, private PATH). Sourced by `~/.zshenv`; not overwritten by reinstall. |
| `~/.config/zshrc/*.zsh` | Your overlays, sourced by `~/.zshrc` **before** oh-my-zsh loads. |
Do not put personal tweaks into `~/.zshrc` if you want painless upgrades: put them under `~/.config/zshrc/` instead.
Do not put personal tweaks into `~/.zshrc` if you want painless upgrades: interactive overlays go under `~/.config/zshrc/`; early PATH/env that non-interactive agents need go in `~/.config/zshenv.local`.
## Personal configuration