I want to implement a function, when I enter a directory through cd, it will automatically scan whether the alias.sh file exists in the directory.

If the file exists, source it to load it. alias.sh is used to save alias configurations, but these alias configurations are only valid for one project, so it is required to automatically log out these alias configurations when exiting this directory.

Simply put, how to use zsh's directory entry hook and directory exit hook?

  • Why is this question tagged with zsh and bash?
    – Cyrus
    Jan 23 at 13:37


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.