This article introduces how to live share command history across multiple terminals in Bash language on Linux PC/server command line.
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
command line - How to share history between terminal tabs? - Ask Different


Note that commands like ssh arenโt reflected until they exit, so be careful about this.