On my Arch Linux machine (5.2.15), history navigation with the arrow keys sees commands in ~/.bash_history that start with the # character.
On my Mac OS machine (bash 3.2.57), history navigation with the arrow keys does not see commands in ~/.bash_history that start with the # character.
The history builtin has the same behaviour: it sees those commands on the Arch machine, but not on OS X. Running history -r doesn't cause the commented commands to show up, though I can see them in ~/.bash_history.
What causes this difference in behaviour and how can I configure bash on Mac OS to behave like it does on Arch Linux (so I see commented history entries)?
Both machines have very similar bash configuration:
Mac OS:
$ shopt -p | grep hist shopt -s cmdhist shopt -s histappend shopt -u histreedit shopt -u histverify shopt -u lithist $ echo $HISTCONTROL ignorespace Arch:
$ shopt | grep hist cmdhist on histappend on histreedit off histverify off lithist off $ echo $HISTCONTROL ignorespace
centos:5docker container, which has3.2.25(1), but not on acentos:6container, which has4.1.2(2). I'm betting this was a bug fixed with 4.0 or 4.1.$HISTIGNOREon the two machines? Does one of them include#*?HISTIGNORE="#*"and then ran#fooand pressing the UP button didn't bring it back. And it seems reasonable that it can't load something if it hasn't saved it. In any case, if it is indeed a bug in an old bash version, there's not much more to add.