cmd: allow "$@" to pass all arguments
Hi, I'm trying to setup lf with zoxide. What I currently have looks something like:
cmd z %{{
res="$(zoxide query "$1")"
lf -remote "send $id cd \"$res\""
}}
I'm using $1 which currently only supports a single argument, but ideally, zoxide should be usable with any number of arguments. It would be great if lf could support a syntax like $@ to pass in all the arguments.
I tried
cmd z %{{
echo "$@"
}}
and it prints out first second third when I execute :z first second third.
lf simply runs the command body as a shell script and passes all the parameters you provide to it, so I don't think there would be an problem with using $@.
Which shell is it running with? Somehow, the syntax: res="$(zoxide query "$@")" doesn't seem to be working correctly, even though it runs just fine in Bash.
That is really weird. I tried the command substitution syntax
cmd z %{{
res="$(echo "$@")"
echo "$res"
}}
with sh, bash and zsh, and it all works as expected.
Which shell are you using? It uses the shell you specify in the shell option.