I've since switched to the fish shell (https://fishshell.com/) which has this built in.
It doesn't matter which shell you use, all the common ones have some kind of plugins or extensions for that.