From fb9af295e0065fd031141b542ddbdb02bcb6988e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Thu, 7 Dec 2023 14:07:34 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(fish):=20yazi=20wrapper=20for?= =?UTF-8?q?=20exiting=20on=20the=20current=20dir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/fish/functions/fe.fish | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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