I've got an annoying problem with iterm2 not remembering my history when I close out a terminal window. I'm not sure if it might be my .bash_profile config or what.
Here is what is happening:
1) type in some commands 2) issue `history` command 3) commands are listed 4) close terminal window and open brand new terminal window 5) issue `history` command 6) commands from previous sessions are NOT listed 7) close terminal window and open brand new terminal window 6) issue `history` command 7) commands from very first session now appearing
Anyone know why the previous commands aren't showing up right away when a new window is opened and only after a second terminal window is opened?
UPDATE: Everything works as expected with the plain old terminal app.
Update 2: I have the shell integration feature installed
Update 3: It turns out the first update was incorrect. It is also flaky on Terminal. Sometimes it will work and other times it doesn't.
SHELL_SESSION_HISTORY=0
to your~/.bash_profile
file, quite the Terminal/iTerm2 App and reopen, test again.~/.bash_profile
withSHELL_SESSION_HISTORY
didn't do anything. The problem was.bash_history
having permissions-rw------- root staff
as set by/etc/bashrc_Apple_Terminal
. Little bit ofchown
ing solved it. Now history works with iTerm2.