I'm running a tmux session with 6 windows, about 14 panes in all. Is there a command way to save this session to a tmux configuration file?
I'm not worried about running any of the programs, but hopefully I'll be able to keep the session name, window names, and pane folder locations.
tmux by default doesn't provide any way to save/restore sessions/clients. But there are 3rd party tools to achieve it.
For example, I wrote retmux
to do exactly what you are asking for.
https://github.com/sk1418/retmux
What can be backed up/restored?
- sessions : with names, terminal-size
- windows : with name, order, pane split and split layout
- panes : with path and content(up to 100000 line history content) with same look and feel (ANSI escapes)
来源:https://stackoverflow.com/questions/45633746/convert-current-tmux-session-to-configuration-file