Set up tmux with the Gruvbox theme
Split panes, sessions that survive a closed window, and a warm Gruvbox status bar, tuned to work well with Ghostty and Claude Code.
- Platform
- macOS on Apple silicon
- Time
- About 10 minutes
- Steps
- 8
tmux lets one terminal window hold many shells, split side by side, and keeps them running after you close the window. This guide installs tmux, adds the Gruvbox theme through the TPM plugin manager, and turns on the settings Claude Code needs inside tmux. Run every command in Ghostty.
Verified with tmux 3.6b · Ghostty 1.3.1 · macOS 27.0
steps
Step 1: Install tmuxThe terminal multiplexer itself.
Install tmux with Homebrew:
Terminal brew install tmuxCheck the version:
Terminal tmux -VExpected output (yours may be newer) tmux 3.6bStep 2: Install TPM, the plugin managerDownloads and loads tmux plugins, including the Gruvbox theme.
TPM, the Tmux Plugin Manager, installs the plugins you list in your tmux config. Download it into the folder where tmux plugins live:
Terminal git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpmStep 3: Write your tmux configTrue color in Ghostty, the settings Claude Code needs, and the Gruvbox plugin.
tmux reads its settings from
~/.tmux.conf. This command backs up the file you already have, if any, then writes a new one in three parts:- Color: tells tmux that Ghostty can show full 24-bit color.
- Claude Code: lets notifications reach Ghostty and makes
Shift+Enterinsert a new line, as the Claude Code docs recommend. - Plugins: loads TPM, the sensible defaults plugin, and the Gruvbox theme, with TPM's
runline kept at the very bottom.
Terminal [ -f ~/.tmux.conf ] && cp ~/.tmux.conf ~/.tmux.conf.bak-$(date +%Y%m%d-%H%M%S) cat > ~/.tmux.conf <<'EOF' # 24-bit color inside Ghostty set -g default-terminal "tmux-256color" set -as terminal-features ",xterm-ghostty:RGB" # Claude Code inside tmux: Shift+Enter newlines, notifications, progress bar # https://code.claude.com/docs/en/terminal-config#configure-tmux set -g allow-passthrough on set -s extended-keys on set -as terminal-features 'xterm*:extkeys' # Plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'egel/tmux-gruvbox' set -g @tmux-gruvbox 'dark' # or 'dark256', 'light', 'light256' # Start TPM (keep this line at the very bottom) run '~/.tmux/plugins/tpm/tpm' EOFThe first setting needs your Mac to know a terminal type called
tmux-256color. This check printsokif it does:Terminal infocmp tmux-256color >/dev/null && echo okIf it prints an error instead, change
tmux-256colortoscreen-256colorin~/.tmux.conf:Terminal sed -i '' 's|"tmux-256color"|"screen-256color"|' ~/.tmux.confStep 4: Start tmux and install the pluginsOne key combination downloads the Gruvbox theme and turns it on.
Start a tmux session named
main:Terminal tmux new -s mainNow install the plugins listed in your config. tmux shortcuts start with the prefix key,
Ctrl+b. PressCtrl+b, let go, then pressShift+i(a capital I).TPM downloads the plugins and reloads tmux, and the status bar at the bottom switches to the Gruvbox colors. When it says Done, press the key it names, Enter or Escape, to continue.
Check that tmux sees Ghostty's full color and extended keys support:
Terminal tmux display -p '#{client_termfeatures}'The list should include
RGBandextkeys, for example:Example output bpaste,ccolour,clipboard,cstyle,extkeys,focus,RGB,titleStep 5: Reload after you edit the configApply changes to ~/.tmux.conf without closing tmux.
tmux reads
~/.tmux.confwhen it starts. After you change the file, run this inside tmux to apply the change right away:Terminal tmux source ~/.tmux.confIf you add a new
@pluginline, pressCtrl+bthenShift+iagain to download it.Step 6: Switch between dark and lightPick one of the four Gruvbox variants, and tweak the status bar if you like.
The theme has four variants.
darkandlightuse the exact Gruvbox colors, which relies on the 24-bit color setting from your config.dark256andlight256use the nearest colors from the older 256-color palette. Without any setting, the plugin usesdark256. This command backs up your config, switches the variant tolight, and reloads tmux. Replacelightwith any of the four names.Terminal cp ~/.tmux.conf ~/.tmux.conf.bak-$(date +%Y%m%d-%H%M%S) sed -i '' "s|^set -g @tmux-gruvbox .*|set -g @tmux-gruvbox 'light'|" ~/.tmux.conf tmux source ~/.tmux.confThe theme also has a few optional settings. Each one goes in
~/.tmux.confabove therunline, because the theme reads them when TPM loads it.~/.tmux.conf # See-through status bar (needs tmux 3.2 or later) set -g @tmux-gruvbox-statusbar-alpha 'true' # Left side: the session name (this is the default) set -g @tmux-gruvbox-left-status-a '#S' # Right side: date, time and host name (US date format shown) set -g @tmux-gruvbox-right-status-x '%m/%d/%Y' set -g @tmux-gruvbox-right-status-y '%H:%M' set -g @tmux-gruvbox-right-status-z '#h'To add one, open the file in nano, the simple editor that comes with macOS:
Terminal nano ~/.tmux.confPaste the line above the
runline, pressCtrl+Othen Enter to save, andCtrl+Xto exit. Then reload tmux as in the previous step.Step 7: Match Ghostty's colors to GruvboxoptionalSwitch Ghostty to its built-in Gruvbox themes, which follow your Mac's light or dark mode.
Ghostty ships with Gruvbox themes, so the whole window can match the tmux status bar. This replaces the coolnight colors from the Ghostty guide.
This command backs up your Ghostty config, then points its
themeline at Gruvbox Dark in dark mode and Gruvbox Light in light mode. If the file has nothemeline yet, it adds one instead.Terminal f=~/.config/ghostty/config.ghostty mkdir -p ~/.config/ghostty && touch "$f" cp "$f" "$f.bak-$(date +%Y%m%d-%H%M%S)" if grep -q '^theme = ' "$f"; then sed -i '' 's|^theme = .*|theme = dark:Gruvbox Dark,light:Gruvbox Light|' "$f" else echo 'theme = dark:Gruvbox Dark,light:Gruvbox Light' >> "$f" fi ghostty +validate-configThe
themeline in your config now reads:~/.config/ghostty/config.ghostty theme = dark:Gruvbox Dark,light:Gruvbox LightPress
Cmd+Shift+,to reload Ghostty. For an exact match, use the tmuxdarkvariant with Gruvbox Dark: both use the same#282828background. Ghostty follows your Mac's appearance on its own, but tmux does not, so switch the tmux variant tolightyourself when you use light mode.Step 8: tmux cheat sheetThe handful of keys and commands you will use every day.
Every tmux shortcut starts with the prefix,
Ctrl+b. Press and release it, then press the next key.Keys What it does Ctrl+bthen%Split the pane into left and right Ctrl+bthen"Split the pane into top and bottom Ctrl+bthen an arrow keyMove to the pane in that direction Ctrl+bthenzZoom the current pane to full size, or back Ctrl+bthenxClose the current pane, after you confirm with yCtrl+bthencOpen a new window, like a tab Ctrl+bthennorpGo to the next or previous window Ctrl+bthen a numberGo to that window Ctrl+bthendDetach, leaving everything running in the background After you detach or close Ghostty, your session keeps running. List your sessions:
Terminal tmux lsReattach to the one named
main:Terminal tmux attach -t mainWhen Claude Code runs inside tmux, its
Ctrl+Bshortcut, which sends a running task to the background, needs two presses, because tmux takes the first one as its prefix.