Tmux

Tmux is a terminal multiplexer that enables users to create and manage multiple terminal sessions within a single window or across different windows. A key feature of tmux is its ability to create persistent sessions that continue running even after the user disconnects or closes their terminal. This allows long-running processes—such as Python scripts, Docker services, or downloads—to continue executing in the background without interruption.

Sessions and Detachment

Users can create a new tmux session using the command tmux new -s [session-name]. Once inside a session, any process or application can be launched and left running. To disconnect from an active session without terminating the running processes, users press Ctrl+B followed by D to detach. The session remains alive on the server, preserving the state of all running applications.

Use Cases

Tmux is particularly useful for remote server work, where network interruptions or terminal closures would otherwise kill running processes. It allows developers and system administrators to maintain multiple independent workspaces, manage long-duration tasks reliably, and reconnect to previous sessions from different machines or at different times.

Source Notes