mirror of
https://github.com/nix-community/home-manager
synced 2024-12-26 03:39:47 +01:00
yazi: fix nushell integration
This commit is contained in:
parent
45724218f2
commit
21e8b7a7df
2 changed files with 12 additions and 4 deletions
|
@ -30,8 +30,12 @@ let
|
||||||
|
|
||||||
nushellIntegration = ''
|
nushellIntegration = ''
|
||||||
def --env ya [args?] {
|
def --env ya [args?] {
|
||||||
let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5)
|
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
||||||
yazi $args --cwd-file $tmp
|
if ($args == null) {
|
||||||
|
yazi --cwd-file $tmp
|
||||||
|
} else {
|
||||||
|
yazi $args --cwd-file $tmp
|
||||||
|
}
|
||||||
let cwd = (open $tmp)
|
let cwd = (open $tmp)
|
||||||
if $cwd != "" and $cwd != $env.PWD {
|
if $cwd != "" and $cwd != $env.PWD {
|
||||||
cd $cwd
|
cd $cwd
|
||||||
|
|
|
@ -3,8 +3,12 @@
|
||||||
let
|
let
|
||||||
shellIntegration = ''
|
shellIntegration = ''
|
||||||
def --env ya [args?] {
|
def --env ya [args?] {
|
||||||
let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5)
|
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
||||||
yazi $args --cwd-file $tmp
|
if ($args == null) {
|
||||||
|
yazi --cwd-file $tmp
|
||||||
|
} else {
|
||||||
|
yazi $args --cwd-file $tmp
|
||||||
|
}
|
||||||
let cwd = (open $tmp)
|
let cwd = (open $tmp)
|
||||||
if $cwd != "" and $cwd != $env.PWD {
|
if $cwd != "" and $cwd != $env.PWD {
|
||||||
cd $cwd
|
cd $cwd
|
||||||
|
|
Loading…
Reference in a new issue