a different approach is to replace bash altogether and switch to modern shells like fish, elvish, murex, nushell (not stable yet afaik) or oils (very interesting approach, it has a bash or sh compatible mode and another one with a more modern and cleaner syntax).