How to share history between terminal tabs?
I don't think there is a way to share history amongst Terminal tabs only, but here is something that could help you.
The history is not something that is handled by your terminal but by your shell (bash, tcsh, zsh, etc.)
Here are some options that'll help you set up a shared history amongst all the terminal windows (the shell instances).
This should be put somewhere in your .bashrc
file.
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"