Closed FreeHarry closed 1 month ago
This is by design - Zoxide cannot trigger the interactive selector when there's only one history entry, which is a limitation of zoxide
itself.
Since Yazi passes --exclude
when calling the selector, Yazi also has to exclude the cwd from history to avoid the flicker caused by zoxide's execution failure due to only one history found.
Hmm. On my linux machine zoxide has no problems if only one entry is in the history. It shows it perfectly in interaction with fzf
. And if the history contains no entries it outputs just "zoxide: no match found". Is it os-dependent what you mentioned?
Oh, they fixed it in zoxide
0.9.5 (specifically in https://github.com/ajeetdsouza/zoxide/commit/dbe6f185cf62744a03c107bae1f6c546daa72fb2#diff-f1a262a75a15c046693e28608e526e2c3d73fa8266139cf692bd8f7a4aae522fL115, where they removed --select-1
for fzf
)
But I can still reproduce it in zoxide
0.9.4:
Considering some users might still be using an older version of zoxide
, let's keep this behavior for now.
If you put the --exclude
also here...
you can reduce the length comparision to 1
...
Then it only shows the No directory history...
-message if HIST_ENTRIES - CWD == 0
. And in all other cases the history is shown correctly.
But I couldn't check this to the zoxide-0.9.4 version.
Yes, but that doesn't change the fact that we still need more than 2 (>= 3) history entries, if one of them is cwd itself, to open the interactive selector.
It just shifts the workload Yazi is doing over to zoxide
, but it won't help with hacking to fix the interactive behavior of the old zoxide
version.
I dug into it and found that zoxide
offers a _ZO_FZF_OPTS
environment variable, which lets you completely rewrite the fzf
parameters to fix the behavior of older zoxide
versions, and this env variable has been supported since 0.4.2, will create a PR for it later.
Please try https://github.com/sxyazi/yazi/pull/1822
I tested it with nightly build on Win11. It works if history length > 0.
But if history length == 0, this message in yazi is shown...
and on the command line this message...
But I according to lua file, I think this message should be shown in yazi:
No directory history found, check Zoxide's doc to set it up and restart Yazi
Or did I need something to configure before using it?
I can't reproduce it. Are you sure you renamed/deleted the db.zo
history database file?
https://github.com/user-attachments/assets/8d1a1643-54aa-4719-89a4-5f8c5309cd6a
What's your zoxide version? Could you try debugging zoxide.lua
a bit as per https://github.com/sxyazi/yazi/issues/1813#issuecomment-2427368115 and see if zoxide query
returns the expected result on your system?
I rechecked the new nightly build and it is working now. Maybe I did something wrong before.
What system are you running Yazi on?
Linux X11
What terminal are you running Yazi in?
kitty
yazi --debug
outputDid you try the latest nightly build to see if the problem got fixed?
No, and I'll explain why below
Describe the bug
If only one entry is in
zoxide
history, Yazi shows the message:No directory history in the database, check out the zoxide docs to set it up
. Even if are two entries in the history, but one of it is the current working directory, the message appears.I except that the history is show as soon as there is at least one entry in the history, also if the entry is the current working directory.
Unfortunately I had no possibility to try nightly build.
Minimal reproducer
z
Anything else?
No response