rcaloras / bash-preexec

⚡ preexec and precmd functions for Bash just like Zsh.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add function of chpwd

FranklinYu opened this issue · comments

chpwd is also a hook function supported by Zsh. Is there any plan to support it?

No plans currently. A naive solution I could think of would probably do something like watch $OLDPWD for any changes on precmd, and if so invoke any chpwd functions set inside a function array.

Doesn't sound too difficult. Feel free to submit a PR @FranklinYu if interested :)

I imagine you could implement a chpwd hook on top of bash-preexec as is :) Not that it's a bad idea to support directly, but it's not strictly necessary either.