wemux: tmux together!

wechat

We visited the terminal multiplexer tmux is one of our earlier articles. It is an awesome tool for multitaskers. wemux builds on tmux (with all its features) and adds support for multiple-users sharing and using the same terminal sessions.

wemux works on a client-server model. One user starts a wemux session as the server and multiple clients can join him in the session. Multiple server instances are also possible.

On the downside, a lot of scattered options, several modes etc. make the utility very difficult to use for irregular terminal users.

Installation

To install wemux on Linux, run:

$ sudo git clone git://github.com/zolrath/wemux.git /usr/local/share/wemux
$ sudo ln -s /usr/local/share/wemux/wemux /usr/local/bin/wemux
$ sudo cp /usr/local/share/wemux/wemux.conf.example /usr/local/etc/wemux.conf
$ sudo cp /usr/local/share/wemux/man/wemux.1 /usr/local/share/man/man1/wemux.1

To upgrade wemux later:

$ cd /usr/local/share/wemux
$ sudo git pull

wemux configuration file is /usr/local/etc/wemux.conf.

Usage

Add the following line in /usr/local/etc/wemux.conf to give permission to user1 and user2 to host wemux servers:

host_list=(user1 user2)

wemux can be configured to use any of 4 modes:

  • Host: user owns the server
    $ wemux
  • Pair: client can control terminal
    $ wemux pair
  • Mirror: view-only, non-interactive
    $ wemux mirror
  • Rogue: joins existing session, client can have independent windows
    $ wemux rogue

Server commands

Start wemux server or attach to an existing server (you can wrap the 2 commands in a script):

$ wemux start
// OR
$ wemux
// AND
$ chmod 1777 /tmp/wemux-wemux

Attach to an existing wemux server (this doesn’t create one if none exists):

$ wemux attach

Stop wemux server and remove temp file:

$ wemux stop
$ rm /tmp/wemux-wemux

Kick a user from wemux server and remove his rogue sessions:

$ wemux kick user3

Configure wemux (use environment variable EDITOR to set preferred editor). Config file is /usr/local/etc/wemux.conf:

$ wemux config

Show connected users:

$ wemux users

Client commands

Join server in mirror, pair or rogue mode:

$ wemux mirror
$ wemux pair
$ wemux rogue

Bail out of rogue mode session:

$ wemux logout

Intelligently detect mode and connect to server (as client):

$ wemux

List currently active wemux servers:

$ wemux list

Multi-server capabilities

Users with permission to start wemux servers can start multiple if the following option is set in the config file:

allow_server_change="true"

Start multiple sessions:

$ wemux join session1 && wemux start
$ wemux join session2 && wemux start

Now clients can join sessions using:

$ wemux join session1 && wemux attach
// OR
$ wemux join session2 && wemux attach

Check the configuration file for more configuration options.

To learn about other options or get further help, run:

$ man wemux

Rating

Features: 4/5
Usability: 3.5/5

On GitHub: wemux

Leave a Reply

Your email address will not be published. Required fields are marked *