I was just thinking the other day I’d also really like that for my terminal history, especially since I’ve often worked at “bring your own device” sized companies.
> Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands.
I key everything off a shell variable called SESSION, and have a few scripts to set that before spinning up a screen/tmux instance if I don't already have one running for the context in question.
There's a somewhat dated snapshot of some of my config files (relevant and otherwise) at https://github.com/dlthomas/config-files