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

zoxide not working #86

Closed
abhinitrajput opened this issue Jun 24, 2024 · 2 comments
Closed

zoxide not working #86

abhinitrajput opened this issue Jun 24, 2024 · 2 comments

Comments

@abhinitrajput
Copy link

Hello Team,

After the latest changes, zoxide is not working find the snap below of error
image
is anyone has faced the same issue
Thanks in advance

@korneltlaczala
Copy link
Contributor

korneltlaczala commented Jun 24, 2024

Hey @abhinitrajput, it does work, it has just been changed

Solution

Just use:

  • cd instead of z
  • cdi instead of zi

Legacy solution

If you wish to keep using the old, shorter z, zi, you can edit your profile.ps1 file

  • Run Edit-Profile function
  • Add this code to the file:
Set-Alias -Name z -Value __zoxide_z
Set-Alias -Name zi -Value __zoxide_zi
  • Save the file

Once you reload the shell, you will have the old commands available (alongside with the cd, cdi commands)

Where was the change

Merging pull request #70 changed the way your powershell session initializes zoxide

New behaviour

I believe, correct me if i'm wrong, that running the line
Invoke-Expression (& { (zoxide init --cmd cd powershell | Out-String) })
sets the alias of cd to __zoxide_z and alias of cdi to __zoxide_zi

You can see that here:

Old behaviour

The line used to be:
Invoke-Expression (& { (zoxide init powershell | Out-String) }), so without the --cmd flag
The default behaviour was to set z as __zoxide_z and z to __zoxide_zi

Summary

In general, you are right.
After the changes z, zi commands are no longer supported by default and have been replaced by cd, cdi

Note

Just know, that you can still use the cd command with its original functionality

@abhinitrajput
Copy link
Author

Hello @korneltlaczala

"Thanks for clearing up the doubt."

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