Tmux 3.3a workflow that finally replaced twenty terminal windows
I resisted tmux for years because the only demos I had seen involved splitting a terminal into nine panes and typing vim in each one. That is not a workflow, that is a screenshot.
What changed my mind was a laptop that refused to wake up cleanly. I had a dev server, a log tail, a database shell and three SSH sessions open in separate Terminal.app windows, and one OS update destroyed all of them. Tmux 3.3a from Homebrew solved that in about a day.
## The boring setup
My whole config is small and I have not felt the need to grow it:
# ~/.tmux.conf
set -g prefix C-a
unbind C-b
bind C-a send-prefix
set -g mouse on
set -g history-limit 20000
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
bind r source-file ~/.tmux.conf \; display 'config reloaded'
Rebinding prefix to Ctrl-a was the single best change. Ctrl-b is an awkward stretch and after a week of Ctrl-a I never went back. -c '#{pane_current_path}' matters more than it looks: new panes open in the directory I am actually in instead of the directory where the session started.
I skipped TPM and the plugin ecosystems. I tried a status-line theme for a month, got tired of updating it, and removed it. The default status bar tells me the session name, window list and clock, which is all I need.
## The error that confused me for a day
I use tmux attach -t work from an SSH session to pick up where I left off. One afternoon I ran tmux new-session -s work inside an already-attached session and got:
sessions should be nested with care, unset $TMUX to force
That message is accurate and completely unhelpful if you do not know it means you are already inside tmux. It happens because the TMUX environment variable is set in the child shell, so tmux assumes you are trying to open a session inside a session. Either detach first with Ctrl-a d, or genuinely force it:
$ env -u TMUX tmux new-session -s work
I hit the same thing from a VS Code integrated terminal, which inherits TMUX from the parent process. If you use a terminal multiplexer inside an editor, check the environment before blaming the config.
The opposite problem is also common:
$ tmux attach -t work
can't find session work: no such session
Usually the server died with the last session, or you are on a different user or machine than you think. tmux ls tells you what is actually running.
## Mac-specific pain
On macOS 14 the default shell is zsh and tmux does not read .zshrc for login shells in the same way Terminal.app does, so nvm vanished from my panes. The fix was set -g default-command "/bin/zsh -l" in the config. If you use Homebrew's tmux and path helpers, note that Apple moved things around and you may need to re-run brew link after an OS upgrade.
## The part I did not expect
The real win is not persistence, it is that sessions have names. work, dotfiles, that-one-client are visible from tmux ls and I can drop into exactly the right context from any terminal. I keep about three sessions and kill them when the work is done. Twenty panes in one session is just twenty windows with extra steps.
I still do not use synchronized panes or copy mode properly. If you have a good way to move text between a tmux pane and the system clipboard on Linux without xclip, tell me.