Closed ad-on-is closed 1 year ago
Sorry to bother, but this was an issue with zoxide. https://github.com/aymanbagabas/dotfiles/commit/30e8323147281b07a9f77879b6d14881acbf0ff4
maybe-stupid question, why reply=(${(f)"$(zoxide query -l)"})
and not typeset -ga reply=(zoxide query -l)
like in the README?
@stefan2904 I just followed a guide that I found online a few years ago.
typeset -ga reply=(zoxide query -l)
does not work correctly. Just try it on the command line:
% typeset -ga reply=(zoxide query -l); typeset -p1 reply
typeset -a reply=(
zoxide
query
-l
)
%
reply=( ${(f)"$( zoxide query -l )"} )
is the correct way to do it:
"$( <command> )"
preserves all whitespace in <command>
's output.${(f)"$( <command> )"}
splits the output on newlines.
typeset -ga reply=(zoxide query -l)
does not work correctly. Just try it on the command line:% typeset -ga reply=(zoxide query -l); typeset -p1 reply typeset -a reply=( zoxide query -l ) %
reply=( ${(f)"$( zoxide query -l )"} )
is the correct way to do it:* `"$( <command> )"` preserves all whitespace in `<command>`'s output. * `${(f)"$( <command> )"}` splits the output on newlines.
That's how I have it, but strangely it doesn't work in the users home-directory.
If, in the home-directory I type cd foo
, I'd expect it to show all recent directories containing foo, but it does not.
Doing a zoxide query -l foo
however brings up a few results.
If I cd
into ~/Downloads and do the same, the results come up.
@ad-on-is And is that a problem in Autocomplete or in Zoxide?
I had this code in my .zshrc file for recent directories. This stopped working. Were there any breaking changes introduced recently?