Files
archived-solorice/config/fish/functions/yazicd.fish
2026-02-09 22:52:34 +02:00

14 lines
440 B
Fish

function yazicd --description "yazi wrapper that cd's to last directory"
set -l tmp (mktemp -t "yazi-cwd.XXXXXX")
command yazi $argv --cwd-file="$tmp"
if read -z cwd < "$tmp"; and [ "$cwd" != "$PWD" ]; and test -d "$cwd"
z -- "$cwd"
eza -a --icons --group-directories-first
end
rm -f -- "$tmp" >/dev/null
# restore insert cursor (beam)
printf '\e[5 q'
commandline -f repaint 2>/dev/null
end