You can use tmux grouped session.
First, create initial session, change its name to share
:
$ tmux
$ tmux list-session
0: 1 windows (created Wed Aug 27 00:14:05 2014) [80x23] (attached)
$ tmux rename-session -t 0 share
$ tmux list-session
share: 1 windows (created Wed Aug 27 00:14:05 2014) [80x23] (attached)
Then, from other client, you simply add -t
option and grouped session name (in this example, it's share
) to tmux new-session
command:
$ tmux new-session -t share -s cuonglm
-s
option set the session name. If other user, i.e wiso, want to attach grouped session, he simply do:
$ tmux new-session -t share -s wiso
From man tmux
:
If -t is given, the new session is grouped with target-session. This
means they share the same set of windows - all windows from
target-session are linked to the new session and any subsequent new
windows or windows being closed are applied to both sessions. The
current and previous window and any session options remain independent
and either session may be killed without affecting the other. Giving
-n or shell-command are invalid if -t is used.