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

checking zoxide was initialised - zoxide status or env variable!? #923

Closed
ocehugo opened this issue Oct 17, 2024 · 1 comment
Closed

checking zoxide was initialised - zoxide status or env variable!? #923

ocehugo opened this issue Oct 17, 2024 · 1 comment

Comments

@ocehugo
Copy link

ocehugo commented Oct 17, 2024

Hi, I would like to look before initialising zoxide.

It would be great if, instead of checking the existence of the "z" function, I could ask zoxide itself (zoxide status), or to rely upon a default environmental variable (e.g. ZO_INIT=yes).

Reasons: a. initialise once , b. make this the same task check for different shells.

I wonder what the author's preference is here.

@ajeetdsouza
Copy link
Owner

You can check for the existence of the __zoxide_z function. This function is always created upon initialization so that people can alias it / wrap it as per their preferences, and it has the same name across all shells.

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

2 participants