How to share history between terminal tabs? I generally find myself using two or three tabs in my Terminal on OS X.

A minor inconvenience is that, by default, the tabs don't share their command history.  So, searching for a previous command that I ran on another tab by typing history | grep thingIamlooking for does not find it.

Is there a way of forcing Terminal tabs to share history, or is there some other "history_of_all_tabs" command?
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"