tmux-rs
A Rust port of the tmux terminal multiplexer.
tmux-rs is a port of the tmux terminal multiplexer to Rust. This is our
fork of Collin Richards' port, which translated tmux to Rust
almost line for line and is therefore nearly all unsafe code. The fork's
goal is to turn it into safe, idiomatic Rust, one subsystem at a time. It is
alpha quality: expect crashes, and don't rely on it yet.
tmux
tmux lets you run many terminal sessions inside one window, split it into panes, and detach from a session and reattach later. Programs keep running in the background, which is why tmux is a staple on remote servers: a dropped SSH connection no longer kills your work. Nicholas Marriott first released it in 2007. It is part of the OpenBSD base system, runs on most Unix-like systems and is licensed under ISC.
In 2025 Collin Richards published tmux-rs, a complete port of
tmux to Rust. An automatic translation with C2Rust produced code that was
three times larger and unmaintainable, so he translated all of it by hand
instead, function by function: about 67,000 lines of C into 81,000 lines of
Rust. The result behaves like tmux, but because it mirrors the C code so
closely, it is almost entirely unsafe.
This project
The fork continues from there. It replaces raw pointers, C-style unions and manually managed buffers with owned Rust types, working through the input parser, the grid and the client–server protocol in turn. A test harness feeds bytes into the terminal parser and checks the resulting screen state, so each step can be checked against the previous behavior. The fork also builds on macOS and on aarch64 Linux.
Example
tmux-rs uses the same commands and key bindings as tmux:
# Start a named session, then detach from it with Ctrl-b d
tmux-rs new -s work
# Later, or from another SSH connection, pick up where you left off
tmux-rs attach -t work