【问题标题】:Can tmux save commands to a file, like .bash_history?tmux 可以将命令保存到文件中,例如 .bash_history 吗?
【发布时间】:2016-09-07 11:09:13
【问题描述】:

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

【问题讨论】:

    标签: linux history tmux


    【解决方案1】:

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

    历史文件路径

    如果不为空,则 tmux 将在退出时向其中写入命令提示历史记录并在启动时加载它。

    将此添加到您的.tmux.conf

    set -g history-file ~/.tmux_history
    

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

    【讨论】:

      猜你喜欢
      • 2019-11-17
      • 1970-01-01
      • 2012-03-21
      • 1970-01-01
      • 1970-01-01
      • 2010-11-14
      • 2021-02-10
      • 2011-07-16
      • 2011-05-21
      相关资源
      最近更新 更多