fix(shell): avoid zoxide warning about missing cd.fish on fish 4.8+ - #140
Merged
Conversation
Fish 4.8+ embeds builtin functions in the binary and no longer ships share/fish/functions/cd.fish on disk. zoxide's init fish script still tries to read that file to wrap cd, which fails and prints a harmless but noisy warning on every shell startup. Pre-define __zoxide_cd_internal from the live cd function before sourcing zoxide's cached init script, matching the guard check zoxide's own script already performs, so it skips the missing-file read entirely. ajeetdsouza/zoxide#1272 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Fish 4.8+ embeds builtin functions in the binary and no longer ships
share/fish/functions/cd.fishon disk. zoxide'sinit fishscript still tries to read that file to wrapcd, which fails and prints a harmless but noisy warning on every shell startup:Fix
Pre-define
__zoxide_cd_internalfrom the livecdfunction before sourcing zoxide's cached init script, matching the guard check zoxide's own script already performs (if not builtin functions --query __zoxide_cd_internal), so it skips the missing-file read entirely.Upstream issue: ajeetdsouza/zoxide#1272 (not fixed as of zoxide 0.10.0)
No cache invalidation needed —
_evalcacheonly caches zoxide's raw output; the guard runs before that cached script is sourced.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com