Introducing tmux-rs
Hobby Motivation and Reception
- Many commenters appreciate the “for fun” motivation and compare it to other hobby rewrites (e.g., fzf clones) used to learn Rust or algorithms.
- There’s broad support for experimentation without a business case; some argue this kind of tinkering is how real innovation often appears later.
Porting Strategy: 100% Unsafe Rust First
- The project is essentially a transliteration of tmux’s C code into “C written in Rust,” using raw pointers and many
unsafeblocks. - Several people note this is a common two‑step pattern:
- Step 1: get a faithful, mostly mechanical port working (often largely unsafe).
- Step 2: progressively refactor into safe, idiomatic Rust.
- Others criticize the approach: code is ~20–25% larger, still unsafe, and currently less stable than the battle‑tested C version.
Rust vs C (and Go/Zig): Safety, Portability, Value
- Pro‑Rust side:
- Even unsafe Rust is safer than C because all “dangerous” regions are explicitly marked and easier to audit.
- Rewriting in a memory‑safe language is seen as a long‑term win for extensibility, maintainability, and reducing whole classes of bugs, including security issues.
- Skeptical side:
- tmux is already extremely stable with few CVEs; some see little practical gain from a risky rewrite.
- Concerns about Rust’s portability (especially on some OpenBSD targets or obscure platforms) vs C’s ubiquity.
- Some argue a garbage‑collected language (e.g., Go) would be perfectly adequate given tmux’s IO‑bound nature.
- A few feel Rust hype is driving interest more than concrete benefits here.
Automated Translation: c2rust and LLMs
- The author’s experience with c2rust: fast but produced bloated, unidiomatic, hard‑to‑maintain code; eventually discarded in favor of manual porting.
- Discussion suggests c2rust might improve (e.g., preserving constants), but currently isn’t good enough for clean, maintainable Rust.
- LLMs and tools like Cursor were tried late in the process:
- They reduced typing fatigue but still inserted subtle bugs, requiring as much review as manual coding.
- Opinions split: some see automated C→Rust translation as a “killer app” for future AI; others are deeply skeptical that current models can handle a non‑trivial codebase reliably.
Tmux Usage, Issues, and Alternatives
- Users reaffirm tmux as “life in the terminal”: session managers (tmuxinator/rmuxinator), long histories, multiplexing across projects.
- Reported issues: memory use with large scrollback, mouse behavior, keybinding ergonomics, and desires for features like better Windows support or remote backends.
- Comparisons:
- GNU screen vs tmux: defaults (status bar, keybindings) and splits cited as reasons tmux won mindshare.
- zellij (Rust multiplexer) is praised but seen as still missing some tmux features and keybinding flexibility.
- Some doubt tmux maintainers would ever adopt this port; in its current “C-in-Rust” state it’s seen more as an educational fork than a drop‑in successor.