Add this to your .bashrc:
# History stuff.
shopt -s histappend
export HISTFILESIZE=50000
export HISTSIZE=50000
export HISTCONTROL=ignoreboth
export PROMPT_COMMAND='history -a'
Individual shells keep their session history in order, while all commands regardless of which shell triggered them get appended to the history file.