Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility between . ranger and Zoxide #2990

Open
griloHBG opened this issue Jun 27, 2024 · 0 comments
Open

Incompatibility between . ranger and Zoxide #2990

griloHBG opened this issue Jun 27, 2024 · 0 comments

Comments

@griloHBG
Copy link

I have been using Ranger with its nice . ranger approach in order to be dropped into the last folder a navigate to in Ranger after I close it.

Recently I started also using Zoxide.

After I started using Zoxide, after I close the . ranger, after navigating to some folder and closing ranger, I am not dropped to the last folder and I see the following message on my terminal:

zoxide: no match found

Investigating a bit, I think I found where/why the error occurs. Also, I think I know how to solve it, but I would like to know from the developers if my idea is good or bad :)

With Zoxide installed, it is common to alias cd to __zoxide_z.

In this line:

cd -- "$chosen_dir"

We will have:

__zoxide_z -- /path/to/last/dir

This will cause the internals of Zoxide (you can use which __zoxide_z to check) to do this mistake:

zoxide query --exclude /path/to/initial/dir -- -- /path/to/last/dir

Which will bring the error

zoxide: no match found

IMHO, simply modifying cd -- "$chosen_dir" to cd "$chosen_dir" would solve such error.

But if you guys added -- in there, I assume it is because some corner cases might make cd misbehave. At the same time, I didn't find a documentation on cd talking about the possible usage of --.

So: is it "safe" to simply get rid of the --? 🙂

Thanks for your attention 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant