Skip to content

fix(zshrc): set ~/.local/bin on PATH before mise activate#24

Merged
vaintrub merged 1 commit into
masterfrom
fix/zshrc-mise-activate-path-order
May 17, 2026
Merged

fix(zshrc): set ~/.local/bin on PATH before mise activate#24
vaintrub merged 1 commit into
masterfrom
fix/zshrc-mise-activate-path-order

Conversation

@vaintrub
Copy link
Copy Markdown
Owner

Bug

command -v mise && eval "$(mise activate zsh)" ran ahead of export PATH="$PATH:$HOME/.local/bin". On Linux where mise is curl-pipe-installed to ~/.local/bin/mise, the command -v mise check fails because ~/.local/bin isn't on PATH at that point → mise activate silently skipped → tools not on PATH → fzf/zoxide integrations (which depend on mise activate) also don't fire.

Reproduction

Jetson (Ubuntu 22.04 aarch64, zsh login shell):

$ which delta
delta not found
$ mise where aqua:dandavison/delta
/home/vaintrub/.local/share/mise/installs/aqua-dandavison-delta/0.19.2
$ echo $PATH | tr ':' '\n' | grep -c mise/installs
0
$ eval "$(mise activate zsh)"
$ which delta
/home/vaintrub/.local/share/mise/installs/aqua-dandavison-delta/latest/.../delta

So mise is installed, paths exist, but activate never ran in zshrc. Manual eval fixes the session; next session breaks same way.

Why Mac was fine

Brew's .zprofile shellenv adds /opt/homebrew/bin (where brew-installed mise lives) to PATH before .zshrc fires → command -v mise succeeds → activate runs. Linux has no equivalent pre-zshrc PATH setup for ~/.local/bin (Ubuntu's ~/.profile adds it but only for bash; zsh would need ~/.zprofile which we don't deploy).

Downstream effect noticed first

chezmoi diff on jetson kept showing ~/.gitconfig wanting to remove the delta block — {{ if lookPath "delta" }} was evaluating false because chezmoi's rendering process inherited the unactivated shell's PATH. Looked like a chezmoi convergence issue at first; root cause is zshrc ordering.

Fix

Move the PATH extension block above the mise activate line:

PATH += ~/.local/bin, ~/go/bin
mise activate
fzf integration
zoxide init

Matches dependency direction. Mac unaffected (idempotent appends; activate already saw mise on PATH).

Test plan

  • chezmoi apply on Mac workstation — no behavioural change, rtk init still wires correctly
  • Order verified via grep -nE 'PATH|mise activate' dot_zshrc
  • Jetson after merge: chezmoi update && chezmoi apply && exec zsh && which delta → mise install path; chezmoi diff → empty for gitconfig

Order bug: `command -v mise > /dev/null && eval "$(mise activate zsh)"` ran
ahead of `export PATH="$PATH:$HOME/.local/bin"`. On Linux where mise is
curl-pipe-installed to ~/.local/bin/mise, the `command -v mise` check fails
because ~/.local/bin isn't on PATH yet at that point — mise activate
silently skipped, no tools on PATH, fzf/zoxide integrations don't fire
either (both depend on mise activate having run).

Manifests on jetson (Ubuntu 22.04 aarch64): SSH'd into zsh login shell,
`which delta` → not found, despite `mise where aqua:dandavison/delta`
returning a valid install path. `eval "$(mise activate zsh)"` manually
fixes the session but the next session breaks the same way.

Works fine on Mac because brew's `.zprofile` shellenv adds
`/opt/homebrew/bin` (where brew-installed mise lives) to PATH before
.zshrc fires — `command -v mise` succeeds, activate runs. Linux has no
equivalent pre-zshrc PATH setup for ~/.local/bin (Ubuntu's ~/.profile
adds it but only for bash, not zsh; zsh would need ~/.zprofile which we
don't deploy).

Fix: move the PATH extension block above the mise activate line. Order
is now PATH → mise activate → fzf → zoxide, matching dependency direction.
Mac unaffected — appends are idempotent and mise activate already saw
mise on PATH there.

Verified by `chezmoi apply` on workstation Mac (no behavioural change),
and matches the manual `eval "$(mise activate zsh)"` reproduction on
jetson.
@vaintrub vaintrub merged commit 4c92fc8 into master May 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant