tmux or a window manager on a Mac?

Updated · by , maker of Ribbon

tmux arranges terminals inside one terminal window and keeps sessions alive when you disconnect, which matters most on remote machines. A window manager arranges every window on your Mac, terminals, browsers and editors alike. If all your work is in a terminal, tmux alone can be enough. If you mix terminals with GUI apps, you want a window manager, and many people use both.

What each one does

tmuxWindow manager
ArrangesPanes inside one terminal windowEvery app's windows on screen
Survives disconnectYes: detach, reattach later, even over SSHNo; it arranges, it doesn't host
Works over SSHYes, and that's its main strengthOnly arranges the local terminal window
Mixes in GUI appsNoYes
Config~/.tmux.confVaries: a file or a settings window

When tmux alone is enough

Install it with brew install tmux. The prefix is ⌃B by default; many people move it to ⌃A or ⌃Space.

When you want a window manager

Using both

The common split of jobs:

Two things keep them from tripping over each other:

  1. Different modifiers. tmux uses a ⌃-key prefix and then a plain key. A window manager on ⌃⌥ or a Hyper key never collides with it.
  2. Same direction keys. Bind tmux pane movement to prefix plus H/J/K/L, and use H/J/K/L with the window manager's modifier for windows. Same muscle memory, two levels.

A minimal ~/.tmux.conf for that:

set -g mouse on
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

Ribbon alongside tmux

Ribbon is a scrolling window manager whose defaults are ⌃⌥H/J/K/L for focus and ⌃⌥⇧ plus the same keys to move windows, so it sits one level above tmux's prefix-hjkl without clashing. Each terminal window gets its own column on a horizontal strip, next to your browser and editor columns; opening another terminal adds a column instead of shrinking the rest. Stacks (⌃⌥]) put two terminal windows in one column, top and bottom, which covers the "two panes" case without tmux if you're working locally. Try it in the live demo; pricing is $9.99 once.

FAQ

Do I need tmux on a Mac?

Not for local work if your terminal has splits and tabs, or you use a window manager. tmux earns its place on remote machines and for sessions that must survive disconnects.

Can tmux replace a tiling window manager?

Only for terminal programs. It can't arrange a browser or an editor that isn't running in the terminal.

Will window manager shortcuts conflict with tmux?

Not if the window manager uses a different modifier, such as ⌃⌥ or a Hyper key. tmux's prefix is a single ⌃ combination followed by a plain key.

Keep reading