Open mpapis opened 10 years ago
I have created a common repository jst for the "bash zsh support" part, you can follow it here https://github.com/mpapis/bash_zsh_support
Related: my PR to add (zsh's) chpwd to the config tool, and prefer it: https://github.com/cxreg/smartcd/pull/26
@mpapis
this will be compatible with all other software implementing the same mechanism
So for smartcd it could instead look for $chpwd_functions
instead of testing for $ZSH_VERSION
,
and the user would have to provide the compatibility wrapper like in your example?
user does not have to provide the wrapper, every tool can redefine it, there is no harm in defining the same functions many times, and yes you can simplify your code to load the wrappers when not in zsh and add hook to chpwd_functions
Great. Then smartcd could use the same/better implementation for both bash and Zsh, dropping/deprecating the cd/pushd/popd approach.
@cxreg do you agree?
following https://github.com/wayneeseguin/rvm/issues/2819 - explicit support for
smartcd
was removed from RVM and replaced with generic handlerchpwd_functions
implemented in accordance to Zsh specification => http://zsh.sourceforge.net/Doc/Release/Functions.html#Hook-Functionsyou can implement the same mechanism using this code:
from now on adding code to execute after
cd
is as easy as:and this will be compatible with all other software implementing the same mechanism