Can tmux save commands to a file, like .bash_history? Can tmux save commands to a file, like .bash_history? linux linux

Can tmux save commands to a file, like .bash_history?


There is history-file option which does what you are looking for.

history-file path

If not empty, a file to which tmux will write command prompt history on exit and load it from on start.

Add this to your .tmux.conf

set -g history-file ~/.tmux_history

Note it was added in 2.1 version. if you have older version of tmux readhttps://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file