Building tmux from source | Generated by AI

Home 2026.06

Here’s the full build process:

Problem: tmux not installed, brew too slow, building from source needed.

Dependencies discovered:

Step 1: Download source tarballs

cd ~/tmp-build
curl -fSL -o libevent-2.1.12-stable.tar.gz \
  https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
curl -fSL -o tmux-3.7.tar.gz \
  https://github.com/tmux/tmux/releases/download/3.7/tmux-3.7.tar.gz

Step 2: Build libevent (~30 seconds)

cd libevent-2.1.12-stable
./configure --prefix=$HOME/.local --disable-shared --disable-openssl
make -j4
make install

Step 3: Build tmux (~20 seconds)

cd tmux-3.7
SDK=$(xcrun --show-sdk-path)
CFLAGS="-I$HOME/.local/include -I${SDK}/usr/include" \
LDFLAGS="-L$HOME/.local/lib" \
./configure --prefix=$HOME/.local --disable-utf8proc
make -j4
make install

Step 4: PATH setup

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc

Result:

~/.local/bin/tmux 3.7
~/.local/lib/libevent*.a (static, no runtime dependency)

Why this works without brew:

Cleanup: rm -rf ~/tmp-build — source tarballs no longer needed after install.


Back Donate