From 2a72bfec77602b92f89ef1b75a132e20c8f7a32f Mon Sep 17 00:00:00 2001 From: Illia Grybkov Date: Mon, 31 Aug 2026 09:46:57 -0500 Subject: [PATCH] fix(shell): avoid zoxide warning about missing cd.fish on fish 4.8+ 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. https://github.com/ajeetdsouza/zoxide/issues/1272 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../shell/files/dotfiles/config/fish/conf.d/zoxide.fish | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/profiles/shell/files/dotfiles/config/fish/conf.d/zoxide.fish b/profiles/shell/files/dotfiles/config/fish/conf.d/zoxide.fish index eccd453..f7ba74c 100644 --- a/profiles/shell/files/dotfiles/config/fish/conf.d/zoxide.fish +++ b/profiles/shell/files/dotfiles/config/fish/conf.d/zoxide.fish @@ -1,6 +1,15 @@ if status is-interactive # zoxide initialization if type -q zoxide + # Work around fish 4.8+ no longer shipping functions/cd.fish on disk + # (builtins are now embedded in the binary), which makes zoxide's + # init script emit a harmless but noisy warning when it tries to + # read that file. Pre-define __zoxide_cd_internal from the live + # `cd` function so zoxide's script finds it already defined. + # https://github.com/ajeetdsouza/zoxide/issues/1272 + if not builtin functions --query __zoxide_cd_internal + functions cd | string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' | source + end _evalcache zoxide init fish | source end end