= Multiplexer smackdown

Linux users, in my experience, need a lot of virtual visual space.
One terminal window is never enough, so terminals have tabs.
One desktop is too constraining, so there are virtual desktops.
And sure, application windows can stack, but how much better is it when they tile?
Heck, even the back-end text console has F1 to F7 available for flipping back and forth between tasks.

With this much multi-tasking going on, it's no surprise that eventually somebody invented the concept of a terminal _multiplexer_.
This is a confusing term, admittedly.
In traditional electronics, a "multiplexer" is a component that receives several input signals, and forwards the selected one to a single output.
A terminal multiplexer does the opposite.
It receives instructions from one input (the human at the keyboard, typing into one terminal window) and forwards that input to any number of outputs (for example, a group of servers).

Then again, the term "multiplex" is also a term popular in the US for a cinema with many screens (sharing mindshare with the term "cineplex").
In a way, that's pretty descriptive of what a terminal multiplexer can do: it can provide lots of screens within just one frame.

Whatever the term means, anybody who's tried a multiplexer has their favourite, so I decided to take a look at a few of the popular ones to see how each one measured up.
At the bare minimum, I required a multiplexer to be able to both split and stack terminal windows.

== Tmux

image: smackdown-tmux.jpg

=== Features

As far as I know, it was tmux that started using the "multiplexer" term.
It's great at what it does.

It runs, essentially, as a daemon so your terminal session remains active even after closing the terminal emulator you're viewing it in.
It splits your terminal screen into panes so you can open unique terminal prompts in each.

By extension, this means you can also connect remotely to any number of systems and have them open in your terminal, too.
Using tmux's ability to mirror (or reverse multiplex, in 'tron terms) input to other open panes, it's possible to control several computers at one time, from one central command pane.

=== Size

Installing tmux from a package occupies roughly 700K, not counting the dozen shared libraries it depends upon.

=== Control

The default trigger key for tmux is *Ctrl+B*, although this can easily be redefined in its configuration file.

=== Hacker factor

Tmux had vertical splits when GNU Screen only had horizontal splits, and that attracted fans looking for maximum flexibility.
And flexibility is what users get with tmux.
It can split, stack, select, and serve, there's practically nothing it can't do.

== GNU Screen

image: smackdown-screen.jpg

=== Features

Like tmux, GNU Screen runs a daemon so your shell is available even after you've closed the terminal you used to launch it.
You can connect from separate computers and share Screen.
It splits your terminal screen into horizontal or vertical panes.

And unlike tmux, GNU Screen can connect over a serial connection (`screen 9600 /dev/ttyUSB0` is all it takes), with key bindings for easy XON and XOFF signals.

=== Size

Installing GNU Screen from a package occupies roughly 970K, not counting the dozen shared libraries it depends upon.

=== Control

The default trigger key for GNU Screen is *Ctrl+A*, which can be particularly annoying for anyone familiar with Bash shortcuts.
Luckily, the trigger can easily be redefined in its configuration file.

=== Hacker factor

It's probably less common to need a multiplexer over a serial connection than oven an SSH session, so Screen's really special feature is lost on most users.
Still, GNU Screen is a great multiplexer with many useful options, and if you really really need to send signals to multiple servers at once, there are always dedicated tools like ClusterSSH and https://opensource.com/article/19/2/quickstart-guide-ansible[Ansible].

== Konsole

image: multiplex-konsole.png

=== Features

For not billing itself as a multiplexer, Konsole is a surprisingly effective multiplexer.
It can do the requisite splitting and stacking of windows using Qt panes and tabs, but it can also echo input from one pane to another (or all) through an option in the *Edit* (*Copy input to*) menu.

The most notable feature that it lacks, however, is the ability to run as a daemon for remote reconnection.
Unlike Tmux and GNU Screen, you can't connect remotely to a machine running Konsole and join the session.
For some admins, this may not be an issue.
Many admins VNC to machines more often than they SSH, so "rejoining" a session is as trivial as clicking on the Konsole window in a VNC client.

=== Size

Konsole itself is roughly 11 KB, but it relies on 105 KDE and Qt libraries, so effectively it's more like 50 MB at minimum.

=== Control

Most important Konsole shortcuts start with *Shift+Ctrl*, and that's the case with splitting screens, opening new tabs, copying input to other panes, and so on.
It's just Konsole, so if you're comfortable with the Plasma desktop, this feels familiar.

=== Hacker factor

Using Konsole as a multiplexer is a power move for KDE geeks.
Konsole was the first Linux terminal I used (to this day, I sometimes press *Ctrl+N* for a new tab), so having the ability to use this familiar terminal as a multiplexer is a great convenience.
It's by no means a necessity, because tmux and Screen both run inside Konsole anyway, but by letting Konsole handle panes, I don't have to adjust my muscle memory.
This kind of subtle feature inclusion is exactly https://opensource.com/article/19/12/linux-kde-plasma[what makes KDE so great].

== Terminator

image: multiplex-terminator.png

=== Features

For Gnome users, the Terminator multiplexer is an easy way to add power to their otherwise minimal Gnome terminal.
In addition to the requisite multiplex features, Terminator can broadcast input to all open panes, but like Konsole it can't run in the background so you can reattach to it over SSH.
Then again, with Gnome and Wayland making VNC so easy, it's possible that you won't feel the need to SSH in to continue a terminal session.

If you want it to be, Terminator can be entirely mouse-driven.
Konsole has the same ability, but through its main menu.
With Terminator, you can right-click anywhere in your shell and bring up relevant options to split the window horizontally or vertically, group panes together so you can target them for broadcasts, broadcast input, close panes, and so on.
You can configure keyboard shortcuts for all of these actions, as well, so in many ways it's up to you to build your own experience.

=== Size

Terminator is 2.2 MB to install, most of which are Python modules.
It relies on GTK3 and Gnome, though, so if you're not running the full Gnome desktop you can expect a much larger install for pulling in these dependencies.

=== Control

There's not much consistency in Terminator's default controls.
You use the *Alt* key for some commands, *Ctrl* for others, *Shift+Ctrl*, *Ctrl+Alt*, *Shift+Super*, and the mouse.
Then again, it's one of the most configurable multiplexers I tried, so with an opinion and a little  effort, you can design a schema that works for you.

=== Hacker factor

I consider myself mostly a KDE user, and so when I say that Terminator feels like a K-app, I mean that as a great compliment.
Terminator is a surprisingly configurable and flexible application, and in many ways it exemplifies the power of open source by taking the humble Gnome Terminal and transforming it into a powerful multiplexer.

== Choose them all

There are more multiplexers out there, and several applications with multiplex-like abilities.
Your task doesn't have to be to find the _one_ multiplexer that does everything you need it to do in exactly the way you want it done.
You're allowed to use more than one.
In fact, you can even use more than one at the same time, because tmux and Screen are effectively shells while Konsole and Terminator are terminals that display a shell.
The important thing is that you feel comfortable with the tools at your fingertips, and that they help you manage your workspace so you can work efficiently.

Go try a multiplexer, or discover multiplex-like features in your favourite application.
It might just change the way you view computing.