ChrisTitusTech / powershell-profile

Pretty PowerShell that looks good and functions almost as good as Linux terminal
598 stars 337 forks source link

zoxide not working #86

Closed abhinitrajput closed 3 months ago

abhinitrajput commented 3 months ago

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 commented 3 months ago

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

Solution

Just use:

Legacy solution

If you wish to keep using the old, shorter z, zi, you can edit your profile.ps1 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 https://github.com/ChrisTitusTech/powershell-profile/pull/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 commented 3 months ago

Hello @korneltlaczala

"Thanks for clearing up the doubt."