I've got MacBook from work and try to make it work similar to Linux. This is my config for history in bash:
# When the shell exits, append to the history file instead of overwriting it
export HISTCONTROL=ignoreboth
export HISTSIZE=80000
export HISTFILESIZE=100000
export HISTTIMEFORMAT="%Y-%m-%d %T "
# append to the history file, don't overwrite it
shopt -s histappend
# After each command, append to the history file and reread it
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
It's part of my dotfiles repo.
The setup suppose to work so commands from all terminal tabs/windows are added to history. This works perfect on Linux. But on Mac in some tabs history command only return one entry (the history command I just executed) and everything breaks. fzf show error:
`__fzf_history__`-bash fc: history specification out of range.
Can you explain what is happening and how to fix history in bash on MacOS?