diff --git a/.config/fish/functions/fe.fish b/.config/fish/functions/fe.fish index 11bba05c..02aeb092 100644 --- a/.config/fish/functions/fe.fish +++ b/.config/fish/functions/fe.fish @@ -1,4 +1,8 @@ -function fe --wraps=yazi --description 'alias fe=yazi' - yazi $argv - +function fe + set tmp (mktemp -t "yazi-cwd.XXXXX") + yazi --cwd-file="$tmp" + if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + cd -- "$cwd" + end + rm -f -- "$tmp" end