yazi: update shell integrations (#5048)
(cherry picked from commit 1d085ea444
)
This commit is contained in:
parent
8f21edd1e4
commit
d6bb9f934f
|
@ -8,7 +8,7 @@ let
|
||||||
|
|
||||||
bashIntegration = ''
|
bashIntegration = ''
|
||||||
function ya() {
|
function ya() {
|
||||||
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||||
yazi "$@" --cwd-file="$tmp"
|
yazi "$@" --cwd-file="$tmp"
|
||||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||||
cd -- "$cwd"
|
cd -- "$cwd"
|
||||||
|
@ -29,18 +29,14 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nushellIntegration = ''
|
nushellIntegration = ''
|
||||||
def --env ya [args?] {
|
def --env ya [...args] {
|
||||||
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
||||||
if ($args == null) {
|
yazi ...$args --cwd-file $tmp
|
||||||
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
|
||||||
}
|
}
|
||||||
rm -f $tmp
|
rm -fp $tmp
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
let
|
let
|
||||||
shellIntegration = ''
|
shellIntegration = ''
|
||||||
function ya() {
|
function ya() {
|
||||||
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||||
yazi "$@" --cwd-file="$tmp"
|
yazi "$@" --cwd-file="$tmp"
|
||||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||||
cd -- "$cwd"
|
cd -- "$cwd"
|
||||||
|
|
|
@ -2,18 +2,14 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
shellIntegration = ''
|
shellIntegration = ''
|
||||||
def --env ya [args?] {
|
def --env ya [...args] {
|
||||||
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
||||||
if ($args == null) {
|
yazi ...$args --cwd-file $tmp
|
||||||
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
|
||||||
}
|
}
|
||||||
rm -f $tmp
|
rm -fp $tmp
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
let
|
let
|
||||||
shellIntegration = ''
|
shellIntegration = ''
|
||||||
function ya() {
|
function ya() {
|
||||||
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||||
yazi "$@" --cwd-file="$tmp"
|
yazi "$@" --cwd-file="$tmp"
|
||||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||||
cd -- "$cwd"
|
cd -- "$cwd"
|
||||||
|
|
Loading…
Reference in a new issue