wemux enhances tmux to make multi-user terminal multiplexing both
easier and more powerful. It allows users to host a wemux server and
have clients join in either:
Mirror Mode gives clients (another SSH user on your machine) read-only
access to the session, allowing them to see you work, or
Pair Mode allows the client and yourself to work in the same terminal
Rogue Mode allows the client to pair or work independently in another
window (separate cursors) in the same tmux session.
It features multi-server support as well as user listing and
notifications when users attach/detach.
It is a shellscript wrapper over tmux – no compiling necessary.
I’ve tried this on Ubuntu but don’t see why it wouldn’t work on other unix variants.
If both users are members of a common group and the socket-path uses that group both users will be able to attach fine.
Rather than having to change the permissions of the socket-path every time you create one you could create a specific directory for sockets (I used /var/tmux).
First add a group for tmux users
$ addgroup $TMUX_GROUP
Create a directory with the group set to $TMUX_GROUP and use the setgid bit so that files created within the directory automatically have the group set to $TMUX_GROUP.
$ mkdir /var/tmux $ chgrp $TMUX_GROUP /var/tmux $ chmod g+ws /var/tmux
Next make sure the users that want to share the session are members of $TMUX_GROUP
$ usermod -aG $TMUX_GROUP user1 $ usermod -aG $TMUX_GROUP user2
Now you create a shared session with
$ tmux -S /var/tmp/shared-session
and attach to it from another account with
$ tmux -S /var/tmp/shared-session attach
This is not exclusive to tmux, but right now it’s what I’m using:
You can use
script -f /path/to/some/file to write a terminal session to a file. The
-f option updates the file while you type.
Someone else (with only read permissions to the file, if you want) can do
tail -f to see the file, your terminal session. The
-f option makes
tail output whatever gets appended.
The combination of the two “sync” the view of a terminal. When used whith tmux, it also has the advantage of avoiding the resize that happens when both users have different resolutions. Another trait is that each user can work on another private window or session.
One potential inconvenience is that some commands (ncurses based for example) may do weird things to the output, escape sequences too (colors). However, I am using this inside tmux, and it seems that tmux fixes those issues. I can see the other user read man pages and use other commands that create buffers, colors are displayed right, etc.
This does not allow to write to each other’s terminal though (maybe some other solution could be added for that).
I like to have a window with two panes: one pane running
script -f for my peer to see, an another one next to it where I
tail -f it’s terminal.
It works in ttys as well (and sockets or named pipes may be used too for the file)