有没有一种简单的方法来保存 TMUX 窗格的位置和大小

Is there a simple way to save TMUX pane position and size

我最近开始在我的 raspberry pi 上使用 tmux,并已将它设置为在我从我的电脑启动 SSH 时打开我的会话,但是当我重新启动我的 PI 时它会关闭会话并且我丢失了我的窗格设置.那么有没有什么好的方法可以保存pane的位置大小甚至只保存session呢?

您可以使用 Tmux Resurrect 插件。

Saves all the little details from your tmux environment so it can be completely restored after a system restart (or when you feel like it). No configuration is required.

This plugin goes to great lengths to save and restore all the details from your tmux environment. Here's what's been taken care of:

  • all sessions, windows, panes and their order
  • current working directory for each pane
  • exact pane layouts within windows (even when zoomed)
  • active and alternative session
  • active and alternative window for each session
  • windows with focus
  • active pane for each window
  • "grouped sessions" (useful feature when using tmux with multiple monitors)
  • programs running within a pane! More details in the restoring programs doc.