Files
dotfiles/.config/fish/functions/y.fish
2025-05-10 10:18:28 +03:00

12 lines
281 B
Fish

function y --wraps 'yazi' --description 'TUI file manager'
set -l tmp (mktemp -t 'yazi_cwd.XXX')
yazi --cwd-file="$tmp" $argv
set -l cwd (command cat -- "$tmp")
and test -n "$cwd"
and test "$cwd" != "$PWD"
and builtin cd -- "$cwd"
rm -f -- "$tmp"
end