diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index a3d68726..d0d941d1 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -30,8 +30,12 @@ let nushellIntegration = '' def --env ya [args?] { - let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5) - yazi $args --cwd-file $tmp + let tmp = (mktemp -t "yazi-cwd.XXXXX") + if ($args == null) { + yazi --cwd-file $tmp + } else { + yazi $args --cwd-file $tmp + } let cwd = (open $tmp) if $cwd != "" and $cwd != $env.PWD { cd $cwd diff --git a/tests/modules/programs/yazi/nushell-integration-enabled.nix b/tests/modules/programs/yazi/nushell-integration-enabled.nix index aefffb9e..121e2756 100644 --- a/tests/modules/programs/yazi/nushell-integration-enabled.nix +++ b/tests/modules/programs/yazi/nushell-integration-enabled.nix @@ -3,8 +3,12 @@ let shellIntegration = '' def --env ya [args?] { - let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5) - yazi $args --cwd-file $tmp + let tmp = (mktemp -t "yazi-cwd.XXXXX") + if ($args == null) { + yazi --cwd-file $tmp + } else { + yazi $args --cwd-file $tmp + } let cwd = (open $tmp) if $cwd != "" and $cwd != $env.PWD { cd $cwd