feat(fish): preserve directory after Yazi exits

Add the standard cwd-file wrapper so Yazi navigation updates the interactive shell directory.
This commit is contained in:
2026-08-13 15:49:47 +02:00
parent 11d8e9542a
commit f30bf8a3bd
+10
View File
@@ -32,3 +32,13 @@ set --export PATH $BUN_INSTALL/bin $PATH
# opencode
fish_add_path /home/alex/.opencode/bin
# Yazi wrapper that keeps the shell in its selected directory.
function y
set tmp (mktemp -t "yazi-cwd.XXXXXX")
command yazi $argv --cwd-file="$tmp"
if read -z cwd <"$tmp"; and [ "$cwd" != "$PWD" ]; and test -d "$cwd"
builtin cd -- "$cwd"
end
command rm -f -- "$tmp"
end