From ecf72c9cfdc0c8f04ac1e2953bb3703ea6805e05 Mon Sep 17 00:00:00 2001 From: Mark Derricutt Date: Tue, 18 Nov 2025 22:19:41 +1300 Subject: [PATCH] Update zoxide to support Fish 4.1.x (#1046) --- templates/fish.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/fish.txt b/templates/fish.txt index f6ade18..038e08e 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -19,7 +19,11 @@ end # A copy of fish's internal cd function. This makes it possible to use # `alias cd=z` without causing an infinite loop. if ! builtin functions --query __zoxide_cd_internal - string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source + if status list-files functions/cd.fish &>/dev/null + status get-file functions/cd.fish | string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' | source + else + string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source + end end # cd + custom logic based on the value of _ZO_ECHO.