Skip to content

vasic-digital/tmux

Repository files navigation

vasic-digital tmux — optimized + verified containerized build

A reproducible, hardened build of tmux with built-in jemalloc support, OOM-protection helper, and a comprehensive verification gate. Designed to run on any Linux host (Ubuntu, ALT, Fedora, Arch, openSUSE, Alpine) where podman or docker is available.

The eight verification tests are why this matters: a typical "build tmux from source" guide assumes the build worked. This project ships a hard wall — bash scripts/setup.sh will refuse to PATH-export the binary unless 6+ functional tests pass, with 2 honest SKIPs documenting the kernel-level constraints (CAP_SYS_RESOURCE, libjemalloc presence). No PASS-bluffs.

Quick install (one command)

git clone --recurse-submodules git@github.com:vasic-digital/tmux.git ~/Projects/tmux
cd ~/Projects/tmux
sudo bash scripts/install_deps.sh    # one-time host build deps
bash scripts/setup.sh                 # build + verify + install (no sudo)

After setup.sh reports GREEN: open a new shell or source ~/.bashrctmx invokes the verified vasic-digital build (system tmux untouched).

What you get

Component Why
tmux 3.6a (latest stable) Pinned to a known-good upstream tag
Hardened compile flags -O2 -DNDEBUG -fstack-protector-strong -D_FORTIFY_SOURCE=2, RELRO + immediate-binding link
Build-time -ljemalloc jemalloc linked at the binary level (more aggressive RAM return than glibc malloc)
Runtime LD_PRELOAD=libjemalloc.so Wrapper preloads jemalloc even on hosts where the linker resolved a different malloc
OOM-score protection Optional setcap-enabled helper (tmx-oom-set) sets oom_score_adj=-500 on the spawned server, making tmux survive most OOM cascades
Bounded history-limit Explicit 2000 (the default — explicit so future bumps are intentional)
Hermetic install Built artifact lives in tmux/build/. PATH export points there; system tmux untouched. Removable via bash scripts/setup.sh --uninstall.

Verification gate

SUMMARY: PASS=6  FAIL=0  SKIP=2
GREEN: tmux binary verified — safe to PATH-export.

The 8 tests cover: smoke (binary version), session lifecycle, jemalloc loaded via LD_PRELOAD, history-limit honored, clear-history releases memory (the "apparent leak"), 10 concurrent panes, 30-s sustained session no-leak, OOM-score wrapper applies -500.

Two SKIPs are honest precondition gates:

  • 03_jemalloc_loaded SKIPs if host doesn't have libjemalloc — sudo bash scripts/install_deps.sh provides it
  • 08_oom_score_adj SKIPs unless running as root OR the setcap helper is installed — sudo bash scripts/build_oom_set.sh --install enables it

Roadmap

See docs/CONTAINERIZATION_PLAN.md for the per-session containerization plan — each tmux session running in its own cgroup-bounded container so that:

  • 2 CPU + reasonable RAM cap per session
  • Crash isolation: if one session OOMs/crashes, only that session dies; other sessions and their processes survive
  • One-command bootstrap: tmx new <session> transparently creates the container

Repository conventions

This repo follows the vasic-digital anti-bluff covenant: every test that PASSes carries positive evidence of the feature working; every SKIP documents its precondition; every gate has a paired mutation in meta_test_*.sh proving the gate isn't itself a bluff. See CLAUDE.md and Constitution.md.

License

Apache 2.0 — see LICENSE.

About

vasic-digital optimized + verified containerized tmux build — reproducible across hosts, jemalloc-aware, OOM-protected, 8-test verification gate. Reusable on any Linux system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors