Files
dotfiles/fish/.config/fish/functions/y.fish

9 lines
208 B
Fish

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
rm -f -- "$tmp"
end