tmuxでbashの履歴を即座に書き出す設定

function share_history {
    history -a
    history -c
    history -r
}
PROMPT_COMMAND='share_history'
shopt -u histappend