Fix history saving in tmux