Fish does this by default (and much more as well).
Specifically, I'm not sure what "this" is that fish does, as I described interaction of multiple pieces of software and I don't think fish includes a terminal multiplexer?
The history file is set here: https://github.com/dlthomas/config-files/blob/master/.bash.d...