On Mon, Jul 14, 2025 at 7:01 PM jason stein <jstein...@gmail.com> wrote: > > Hi Chet, > thanks for the suggestion. I will update the code when I get a chance to > make dh a loadable builtin.
Your patch modified the cd builtin, and would have to modify pushd and popd as well. You could potentially write and load replacements for all three that call the existing implementations but also track the information dh needs, along with your dh loadable builtin, if you're looking for a project. examples/loadables/necho.c exists to demonstrate replacing an existing builtin. Another alternative would be to implement this behavior with a sourced bash script that itself overloads the cd, pushd, and popd commands. You can implement dh as a function and use global variables to store and update the necessary information each time a relevant command is run.