As far as I can tell, the history of an individual shell is only appended to the .bash_history file when the shell is closed. This means that I frequently lose individual shells' histories on crashes / kernel panics.
Why does the history only get written on closing a session? Is there a way to have each command written at the time of execution? Is there any reason I should not want to have each command written at the time of execution (e.g., performance issues when writing to an enormous bash_history file)?
(I'm using Mac OS X 10.6 and running many tabbed terminals simultaneously with iTerm. I have histappend set along with some other options.
export HISTSIZE=1000000
export HISTTIMEFORMAT="%d/%m/%y %T "
shopt -s histappend
)