Disable Bash sessions
How to disable Bash sessions on Mac OS 10.11 El Capitan, because it's useless.
When I upgraded to OS X 10.11 El Capitan earlier this month, one of the first things I did was open up Terminal.app so that I could install Homebrew, RVM, etc. After a while, I realised that my Bash history wasn’t being saved.
I checked permissions on ~/.bash_history
:
All looks good. Is the history file set correctly?
Again, all looks good. I noticed a new folder in my home directory: ~/.bash_sessions
and this contains what looked to
be Bash history files with hashed file names:
Uncle Google lead me to find someone in the same boat as me: here and the solution was given here. Simply put, “Bash sessions” can be disabled by simply running the following:
Then close your Terminal.app window and re-open to reload the Bash environment. As the answer suggests, that the
presence of the ~/.bash_sessions_disable
file (although empty) instructs Bash to disable the “sessions” feature and
revert to previous behaviour of storing history in the $HISTFILE
(the value of which defaults to ~/.bash_history
).
A little more info on what Bash sessions is can be found here. There might be advantages to using Bash sessions that I’m not aware of…