Skip to content

fix(shell): avoid zoxide warning about missing cd.fish on fish 4.8+ - #140

Merged
igrybkov merged 1 commit into
mainfrom
fix/zoxide-cd-fish-warning
Aug 31, 2026
Merged

fix(shell): avoid zoxide warning about missing cd.fish on fish 4.8+#140
igrybkov merged 1 commit into
mainfrom
fix/zoxide-cd-fish-warning

Conversation

@igrybkov

Copy link
Copy Markdown
Owner

Summary

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:

warning: An error occurred while redirecting file '.../share/fish/functions/cd.fish'
warning: Path '.../share/fish/functions' does not exist

Fix

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 (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 — _evalcache only caches zoxide's raw output; the guard runs before that cached script is sourced.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

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>
@igrybkov
igrybkov enabled auto-merge August 31, 2026 21:26
@igrybkov
igrybkov merged commit a8607ec into main Aug 31, 2026
19 checks passed
@igrybkov
igrybkov deleted the fix/zoxide-cd-fish-warning branch August 31, 2026 21:26
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