tmux 可以将命令保存到文件中,例如 .bash_history 吗?

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

tmux 是否支持将在 "C-b :" 模式下键入的命令保存到文件中?我宁愿浏览我已经输入的命令,也不愿在手册页中查找每个命令。

history-file 选项可以满足您的需求。

history-file path

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

将此添加到您的 .tmux.conf

set -g history-file ~/.tmux_history

注意是2.1版本加入的。如果你有旧版本的 tmux 阅读 https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file