yazi: pass additional args to ya alias
This allows commands like `ya /etc/nixos` and `ya --help` to be used.
(cherry picked from commit abdc82d930
)
This commit is contained in:
parent
d384a0d524
commit
c8a8852b0a
|
@ -9,7 +9,7 @@ let
|
|||
bashIntegration = ''
|
||||
function ya() {
|
||||
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
yazi --cwd-file="$tmp"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
fi
|
||||
|
@ -20,7 +20,7 @@ let
|
|||
fishIntegration = ''
|
||||
function ya
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXX")
|
||||
yazi --cwd-file="$tmp"
|
||||
yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
cd -- "$cwd"
|
||||
end
|
||||
|
@ -29,9 +29,9 @@ let
|
|||
'';
|
||||
|
||||
nushellIntegration = ''
|
||||
def --env ya [] {
|
||||
def --env ya [args?] {
|
||||
let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5)
|
||||
yazi --cwd-file $tmp
|
||||
yazi $args --cwd-file $tmp
|
||||
let cwd = (open $tmp)
|
||||
if $cwd != "" and $cwd != $env.PWD {
|
||||
cd $cwd
|
||||
|
|
|
@ -4,7 +4,7 @@ let
|
|||
shellIntegration = ''
|
||||
function ya() {
|
||||
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
yazi --cwd-file="$tmp"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
fi
|
||||
|
|
|
@ -4,7 +4,7 @@ let
|
|||
shellIntegration = ''
|
||||
function ya
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXX")
|
||||
yazi --cwd-file="$tmp"
|
||||
yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
cd -- "$cwd"
|
||||
end
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
let
|
||||
shellIntegration = ''
|
||||
def --env ya [] {
|
||||
def --env ya [args?] {
|
||||
let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5)
|
||||
yazi --cwd-file $tmp
|
||||
yazi $args --cwd-file $tmp
|
||||
let cwd = (open $tmp)
|
||||
if $cwd != "" and $cwd != $env.PWD {
|
||||
cd $cwd
|
||||
|
|
|
@ -4,7 +4,7 @@ let
|
|||
shellIntegration = ''
|
||||
function ya() {
|
||||
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
yazi --cwd-file="$tmp"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue