I'll often run things for days inside tmux session, and I like to save my bash history daily (I use logrotate). I do not exit tmux session unless necessary. Could I somehow save my tmux history for that day without exiting the session, on a daily basis, maybe force tmux to write to .bash_history without exiting the session?
I tried :save-buffer /home/me/tmux-hist.txt but that only seems to save last command?
Not sure if this question was for this forum, but I managed to solve it, so here is the solution:
This is not a tmux issue, but rather shell/bash "issue". Adding this to .bashrc:
This way commands run in tmux window/pane are added in the history immediately. If you run "echo 1" in pane 1 and then "echo 2" in pane 2 you will see "echo 1" in pane 2 history as well. Daily history is then saved via logrotate.