News for hackers. Stuff that matters.
Re:Show HN: Restore tmux environment after a system restart by AceJohnny2 on Saturday August 30, 2014 @01:56PM (#8247070)
If I undertstand you correctly:

tmux new-session -t <existing_session_name>

(Do a "tmux ls" to see existing sessions)

The one problem with this approach is that each session created this way (i.e. one that "attaches" to an existing session) actually creates a new "mirror" (?) session that will eventually clutter up your list of existing sessions.

My workaround is to create an initial named session (tmux new-session -s name), then attach to that named session. I never use "tmux ls" :p

You may also want to add "set-window-option -g aggressive-resize on" to your .tmux.conf (or prepend with "tmux" and run it in an existing session). To quote the manpage: "will resize the window to the size of the smallest session for which it is the current window, rather than the smallest session to which it is attached".

There are no comments on this comment yet.