Homebrew Path Differences
On Apple Silicon (M1/M2/M3/M4), Homebrew installs binaries to /opt/homebrew/bin (unlike /usr/local/bin on older Intel Macs). Ensure your ~/.zprofile initializes Homebrew: eval "$(/opt/homebrew/bin/brew shellenv)".
macOS is the primary development platform for many tmux power users. tmux runs natively on macOS via Homebrew or MacPorts, and can also be compiled from the latest source. Choose your method below.
Homebrew is the most widely used macOS package manager. It gives you the latest stable tmux binary in seconds.
If you don't have Homebrew yet, install it first:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Run the Homebrew install command to fetch the latest stable release:
$ brew install tmux
Confirm tmux is installed correctly:
$ tmux -V
tmux 3.7c
For users in the MacPorts ecosystem, tmux is available in the ports tree.
$ sudo port install tmux
$ tmux -V
Build the absolute latest version from the official GitHub repository. Requires Xcode Command Line Tools.
$ xcode-select --install
tmux needs libevent and ncurses; building from git also needs autoconf, automake and pkg-config. utf8proc gives correct emoji and wide-character widths on macOS (Homebrew's own build enables it):
$ brew install autoconf automake pkgconf libevent ncurses utf8proc
$ git clone https://github.com/tmux/tmux.git
$ cd tmux
$ sh autogen.sh
$ ./configure --enable-utf8proc && make
$ sudo make install
$ tmux -V
Tips to get the best tmux experience on macOS, including clipboard, terminal integration, and daemon persistence.
macOS uses pbcopy and pbpaste for clipboard access. Add this to ~/.tmux.conf to enable copy-mode clipboard support with vi keybindings:
# macOS pbcopy integration
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
In macOS Terminal.app, enable "Use Option as Meta key" under Settings → Profiles → Keyboard. This lets you use Option+key combinations in tmux copy mode and readline word hopping (Option+f / Option+b).
iTerm2 has native tmux integration via Control Mode (-CC flag). This maps tmux windows and panes directly to native macOS iTerm2 tabs and split windows (full walkthrough in the iTerm2 + tmux guide):
$ tmux -CC
# Or attach to existing session:
$ tmux -CC attach
To start a detached tmux session automatically when you log in, save this as ~/Library/LaunchAgents/com.user.tmux.plist (use /usr/local/bin/tmux on Intel Macs):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>com.user.tmux</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/tmux</string>
<string>new-session</string><string>-d</string><string>-s</string><string>main</string>
</array>
<key>RunAtLoad</key><true/>
</dict>
</plist>
Then load it (or log out and back in) and attach with tmux attach -t main:
$ launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.user.tmux.plist
For the full set of session commands and lifecycle options, see tmux session management.
Ensuring correct PATH resolution on ARM64 macOS machines.
On Apple Silicon (M1/M2/M3/M4), Homebrew installs binaries to /opt/homebrew/bin (unlike /usr/local/bin on older Intel Macs). Ensure your ~/.zprofile initializes Homebrew: eval "$(/opt/homebrew/bin/brew shellenv)".
When compiling tmux from source on Apple Silicon, pass the explicit Homebrew include and library directories to configure: CFLAGS="-I/opt/homebrew/include" LDFLAGS="-L/opt/homebrew/lib" ./configure.
Modern GPU-accelerated terminals on macOS like Ghostty provide instantaneous text throughput inside tmux with native Metal graphics rendering and 24-bit True Color.
Solutions to common installation, terminfo, and clipboard issues on macOS.
eval "$(/opt/homebrew/bin/brew shellenv)" to your ~/.zprofile (or ~/.bash_profile), then restart your terminal.
tmux-yank plugin via TPM (set -g @plugin 'tmux-plugins/tmux-yank'), or manually bind copy-mode to pbcopy: bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy". In terminals that support OSC 52 (iTerm2 with “Applications in terminal may access clipboard” enabled, Ghostty, Kitty, WezTerm) tmux's default set-clipboard external copies to the macOS clipboard without any extra tools.
set -g default-terminal "tmux-256color" and set -as terminal-features ",xterm-256color:RGB" to ~/.tmux.conf, then run tmux kill-server. If programs complain about an unknown terminal tmux-256color (common before macOS 14 Sonoma, whose system terminfo lacks that entry; Homebrew's tmux uses screen-256color there for this reason), use screen-256color instead. iTerm2, Ghostty, WezTerm and Kitty support 24-bit colour; Terminal.app has historically supported only 256 colours, so tmux will approximate 24-bit themes there.
reattach-to-user-namespace with tmux older than 2.6 (released 2017); newer tmux includes its functionality, so remove it from old configs if you see errors. With an old tmux, clipboard and some system services fail without it. Install it with brew install reattach-to-user-namespace and add to ~/.tmux.conf: set -g default-command "reattach-to-user-namespace -l $SHELL".
brew update && brew upgrade tmux. Sessions started before the upgrade still run the old server, and the new client may refuse to talk to it with a protocol version mismatch error. Save your work, run tmux kill-server, then start tmux again. MacPorts users run sudo port selfupdate && sudo port upgrade tmux.
Compare tmux with cmux — the native macOS GUI terminal built for AI agents.
cmux vs tmux Guide →