ajeetdsouza / zoxide

A smarter cd command. Supports all major shells.
MIT License
22.12k stars 537 forks source link

fix command for powershell #680

Closed AbhimanyuAryan closed 7 months ago

AbhimanyuAryan commented 8 months ago

the old command doesn't work and gives error

zoxide: PWD hooks are not supported below powershell 6.
        Use 'zoxide init powershell --hook prompt' instead.
At line:1 char:1
+ . 'C:\Users\aryan\Documents\WindowsPowerShell\Microsoft.PowerShell_pr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Microsoft.PowerShell_profile.ps1
ajeetdsouza commented 7 months ago

PWD hooks work on PowerShell 7+ and above, the prompt hook has been kept as a fallback for older versions. You're probably running PowerShell 5, you can either upgrade it or modify the command to --hook prompt.