1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-09 10:31:06 +01:00

yazi: update shell integrations and docs

This commit is contained in:
XYenon 2023-11-25 16:17:54 +08:00
parent 8cedd63eed
commit a462e7315d
3 changed files with 11 additions and 11 deletions

View file

@ -5,7 +5,7 @@ let
function ya
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi --cwd-file="$tmp"
if set cwd (cat -- "$tmp") && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
cd -- "$cwd"
end
rm -f -- "$tmp"

View file

@ -2,10 +2,10 @@
let
shellIntegration = ''
def-env ya [] {
let tmp = (mktemp -t "yazi-cwd.XXXXX")
def --env ya [] {
let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5)
yazi --cwd-file $tmp
let cwd = (cat -- $tmp)
let cwd = (open $tmp)
if $cwd != "" and $cwd != $env.PWD {
cd $cwd
}