$ account tmux
tmux is a production-grade terminal multiplexer written in C with a client-server architecture. The server process manages sessions, windows, and panes (each backed by a PTY), while client processes connect over a Unix socket and communicate via a versioned imsg-based protocol (PROTOCOL_VERSION 8). The codebase is organized into command dispatch (cmd_entry structs), a grid-based screen buffer with history and reflow, a scene-cached redraw engine, a terminal I/O layer (tty.c) with terminfo parsing and feature negotiation, and an extensive options/hooks/events system. Entry points are tmux.c (main), server.c (event loop), and the control protocol for programmatic clients. Externally it depends on libevent, terminfo, and POSIX/BSD PTY APIs, with a compat/ layer shimming missing functions across a dozen platforms.