fish: switch mise from shims to PATH activation#19
Merged
Conversation
Shims are only generated at `mise reshim` time, so anything added to a tool's bin dir afterward (`cargo install`, `npm i -g`) was invisible until a manual reshim — cargo-audit et al. silently missing from PATH. Plain `mise activate` runs `mise hook-env` from a fish_prompt hook, putting the real bin dirs (incl. ~/.cargo/bin) on PATH, so new binaries appear immediately. hook-env respects entries added after activation, so ~/.local/share/overrides/bin keeps first position (verified across startup, repeated prompts, and version-switching cd). __cached_source now keys the cache on tool + subcommand, not just tool: the old mise.fish cache (shims line) would otherwise keep winning after this change, since args weren't part of the cache key. Old-scheme cache files are cleaned on cold start. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Fish shell initialization to use mise “PATH activation” instead of shims, ensuring dynamically-added tool bins (e.g., ~/.cargo/bin from cargo install, global npm bins) remain visible on PATH without requiring mise reshim. It also hardens the Fish startup caching helper so cached activation output correctly invalidates when arguments change.
Changes:
- Switch Fish mise initialization from
mise activate --shims fishtomise activate fishinzz_01_paths.fish.tmpl. - Update
__cached_sourcecache keying to include subcommands/args and add cold-start cleanup for old cache naming schemes. - Comment-only clarifications around auto-venv behavior and rationale (
__auto_venv.fish,zz_03_interactive.fish).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| dot_config/fish/conf.d/zz_01_paths.fish.tmpl | Moves mise init to PATH activation mode to keep real tool bin dirs on PATH. |
| dot_config/fish/functions/__cached_source.fish | Makes cache filenames include args so changes to activation flags/subcommands invalidate cache; cleans legacy cache files. |
| dot_config/fish/conf.d/zz_03_interactive.fish | Updates explanatory comments for __auto_venv ownership/intent (no behavior change). |
| dot_config/fish/functions/__auto_venv.fish | Updates comments to match the intended division of responsibilities vs mise-managed python. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Shims mode only generates shims at
mise reshimtime, so binaries added afterward (cargo install,npm i -g) were invisible —cargo-audit,sync_dis_boiexisted in~/.cargo/binbut weren't on PATH. This is inherent to shims mode; mise's own docs recommend PATH activation for interactive shells.What
zz_01_paths.fish.tmpl:mise activate --shims fish→mise activate fish. Afish_prompthook now runsmise hook-env, putting real tool bin dirs (incl.~/.cargo/bin) on PATH.__cached_source.fish: cache key now includes the subcommand (mise-activate-fish.fishinstead ofmise.fish). Without this, the old cached shims line would keep winning after the config change — args weren't part of the cache key. Old-scheme cache files are cleaned up on cold start, so the switch takes effect on the first shell afterchezmoi apply, no manual cache clearing.zz_03_interactive.fish/__auto_venv.fish: comment updates only — auto-venv stays (it covers plain-.venvrepos; mise'suv_venv_autoonly ever applies to mise-managed python, which is intentionally not a global tool).Verification
Ran a sandboxed fish (
XDG_CONFIG_HOMEpointing at a copy of the live config with the new files, clean env) through startup, repeatedfish_promptevents, andcdinto/out of a project pinned tobun = "1.3.10":~/.local/share/overrides/binwas$PATH[1]at startup, after repeated prompt hooks, and after version-switchingcdin both directions —hook-envrespects PATH entries added after activation.~/.cargo/binon PATH;cargo-audit(no shim, previously invisible) resolves.node/bunresolve to real install dirs.fish -cstill resolves cargo binaries (activation runs one env pass at source time).Final PATH shape:
🤖 Generated with Claude Code