mpx Documentation

An ultra-performant, zero-overhead terminal multiplexer engineered in Rust: tmux key bindings, crash-resilient with automatic session recovery, zero-flicker rendering, and a sleek fuzzy command palette.

100% Offline & Zero Telemetry Guarantee
mpx contains zero analytics, tracking, or network calls. All IPC is strictly local via Unix sockets or Windows Named Pipes.

Keyboard Shortcuts & Navigation

By default, all multiplexer shortcuts are triggered via the prefix Ctrl-b (configurable via prefix in config.toml). If you pause after the prefix, a shortcut popup automatically lists common actions after which_key_delay_ms (300ms by default, 0 = instant).

Core Navigation

ShortcutActionDescription
Ctrl-SpaceCommand PaletteInstant fuzzy search across sessions, windows, panes, commands, and key bindings (no prefix required)
Prefix < / Prefix >display-menuWindow and pane menus: arrows or j/k move, Enter or an item's key runs it, q or Esc closes. Popups from display-popup run a command in a box over the panes.
Prefix + cNew WindowCreate a new window tab in current directory
Prefix + % / |Split VerticalSplit active pane side by side
Prefix + " / -Split HorizontalSplit active pane top / bottom
Prefix + h j k lFocus DirectionalMove focus left, down, up, or right to the adjoining pane you used most recently; wraps at the window's edge
Prefix + zToggle ZoomZoom active pane to fill 100% of terminal, or unzoom
Prefix + xKill PaneClose active pane (prompts for confirmation); focus returns to the pane you used last
Prefix + &Kill WindowClose active window tab and all child panes
Prefix + [Copy ModeEnter 100k-line Vi scrollback mode with visual selection and regex search
Prefix + sChoose SessionInteractive session and pane chooser
Prefix + wChoose WindowInteractive window and pane chooser
Prefix + $Rename SessionRename the current session
Prefix + ,Rename WindowRename the active window tab
Prefix + ( )Switch SessionPrevious / next session
Prefix + :Command Prompttmux commands with vim aliases (:vsplit, :tabnew, :q)
Prefix + ?Key ListSearchable list of every binding

Mouse Mode


Configuration

mpx reads its configuration from ~/.config/mpx/config.toml (or $XDG_CONFIG_HOME/mpx/config.toml). All configuration options are strictly validated.

Example config.toml

prefix = "C-b"          # Leader key: C-a, C-Space, M-b, etc.
remain_on_exit = false  # Keep panes open after child process terminates (or "failed")
history_limit = 64      # Number of dead panes kept in log history
scrollback_lines = 100000  # Scrollback lines per pane (tmux history-limit)
allow_passthrough = true # Forward DCS tmux and OSC 52 clipboard sequences (or "all")
restore = true          # Recreate layout, pane output and processes across restarts
which_key_delay_ms = 300  # HUD popup delay (0 = instant)
display_panes_time_ms = 1000  # display-panes numbers stay up this long (0 = until a key)

[style]
border_active = "bright-green"
border_inactive = "bright-black"
border_marked = "bright-magenta"
border_style = "single"
status_bg = "dark-green"
status_fg = "black"

[bind]
"M-h" = "select-pane -L"
"$" = "command-prompt -F -I \"#S\" \"rename-session -- '%%'\""

# Process resumption rules for crash & reboot recovery
[[resume]]
name = "claude"
detect = ["claude"]
resume = ["claude", "--resume", "{id}"]
fallback = ["claude", "--continue"]
env_id = "CLAUDE_SESSION_ID"

[[resume]]
name = "omp"
detect = ["omp"]
resume = ["omp", "--restore", "{id}"]
fallback = ["omp", "--continue"]
env_id = "OMP_SESSION_ID"

[[resume]]
name = "nvim"
detect = ["nvim"]
fallback = ["nvim", "-c", "silent! source Session.vim"]

Configuration Reference

OptionTypeDefaultScopeDescription
prefixstring"C-b"TUIPrefix key in tmux notation. Press twice to send literal prefix key to pane.
remain_on_exittrue, false or "failed"falseDaemonKeep panes open after their child process terminates; "failed" keeps only panes that exited non-zero.
history_limitinteger64DaemonNumber of dead/removed panes retained in log buffer for CLI queries.
allow_passthroughtrue, false or "all"trueTUITerminal passthrough sequences (DCS tmux passthrough, OSC 4/10/11/12/52) from the active pane (true), from every pane shown ("all"), or none (false).
scrollback_linesinteger100000DaemonLines of scrollback per pane for captures and copy mode, for panes started afterwards (tmux history-limit). The pane's output log grows past 2 MB to hold them, up to 64 MB.
automatic_renamebooltrueDaemonName windows after their foreground process; false keeps the creation name.
monitor_activitybooltrueDaemonFlag background windows that print output.
monitor_bellbooltrueDaemonFlag background windows that ring the bell.
monitor_silenceinteger (seconds)0DaemonFlag a background window once it has printed nothing for this many seconds; 0 is off.
renumber_windowsbooltrueDaemonClosing a window renumbers the windows after it. false keeps each window's number and leaves a gap; move-window -r renumbers them.
default_terminalstring"xterm-256color"DaemonTERM for panes started afterwards.
default_shellstringunset ($SHELL)DaemonProgram run by a pane started without a command; an absolute path.
default_commandstringunsetDaemonCommand run through the default shell by a pane started without a command.
restorebooltrueDaemonAutomatically restore saved session layout, show each terminal pane's saved output, and resume registered processes on startup. While on, each pane's newest output (up to 2 MB) is saved to the state directory every few seconds; false stops that and deletes it.
which_key_delay_msinteger300TUIMilliseconds to wait after prefix before showing shortcut HUD popup (0 = instant).
display_panes_time_msinteger1000TUIMilliseconds the display-panes numbers stay up (0 = until a key is pressed).
base_indexinteger0TUINumber of the first window (tmux base-index): tabs, Prefix digits and #{window_index}.
pane_base_indexinteger0TUINumber of the first pane as #{pane_index} shows it (tmux pane-base-index).
mousebooltrueTUIfalse turns mouse reporting off and ignores mouse events.
statusbooltrueTUIShow the status line; false gives its row to the panes.
status_linesinteger 1 to 51TUIRows the status line takes (tmux status 2 to 5). Rows after the first show status_format.
status_formatlist of strings (tmux format)emptyTUIstatus_format[N] is drawn on status row N. A non-empty entry 0 replaces the main status line.
status_position"top" or "bottom""bottom"TUIRow of the status line.
status_intervalinteger (seconds)1TUISeconds between timed status redraws; 0 redraws only on events.
status_left, status_rightstring (tmux format)"[#{session_name}] ", "#{?pane_in_mode,[copy] ,}\"#{=21:pane_title}\" %H:%M %d-%b-%y"TUIThe left and right sides of the status line. Supports #[fg=...] styles and strftime. The defaults are tmux's, plus a [copy] badge in copy mode.
status_left_length, status_right_lengthinteger10, 40TUIWidest a status side may be.
window_status_format, window_status_current_format, window_status_separatorstring"#I:#W#{window_flags}", same, " "TUIWindow tab formats and the text between tabs.
status_justify"left", "centre" or "right""left"TUIWhere the window list sits between the two sides.
display_time_msinteger3000TUIMilliseconds a status message stays up (tmux display-time).
mode_keys"vi" or "emacs""vi"TUICopy-mode key table (tmux mode-keys).
set_clipboardbooltrueTUIfalse keeps copy-mode yanks off the system clipboard.
synchronize_panesboolfalseTUIWindows created afterwards start with synchronize-panes on: typed input reaches every pane of the window. set-option -w synchronize-panes changes a window.
[style] status_style, message_style, message_command_style, pane_border_style, pane_active_border_style, window_status_style, window_status_current_style, window_status_activity_style, window_status_bell_style, window_status_last_styletmux style stringempty (no change)TUItmux style strings (fg=, bg=, bold, dim, underscore, italics, reverse, default, none). A value that is not a valid style fails the file to load.
wrap_searchbooltrueTUIfalse stops copy-mode searches at their first or last match (tmux wrap-search).
focus_eventsboolfalseTUIForward the outer terminal's focus in and out to the active pane when it asked for focus reports (tmux focus-events). Moving focus between panes always reports to panes that asked.
extended_keys"off", "on" or "always""off"TUIModified keys as CSI u or modifyOtherKeys sequences (tmux extended-keys). Kitty flags 1, 2, 4, 8 and 16 a pane sets shape its encoding; mpx pushes only flag 1 to the outer terminal and drops release events, so no pane receives a release. Sixel and kitty graphics are not supported.
xterm_keysbooltrueTUIFunction and cursor keys keep their modifiers (tmux xterm-keys).
set_titles, set_titles_stringbool, formatfalse, "#S:#I:#W - \"#T\""TUIOuter terminal title from a format (tmux set-titles, set-titles-string).
bell_action"none", "any", "current" or "other""any"TUIWhich windows' bells ring the outer terminal (tmux bell-action).
visual_bell, visual_activityboolfalse, falseTUIShow bells and window activity on the status row instead of ringing (tmux visual-bell, visual-activity).
resumearray of tablesdefaultsDaemonRules for resuming processes across restarts (repeat [[resume]]).

Session Restore

The daemon snapshots each session's layout as it changes. Every time a session starts, it brings back the windows, splits, working directories and each terminal pane's recent output, and tools resume their sessions through configured [[resume]] rules, whether the last run ended in a crash, a reboot, or mpx kill-server. Start with mpx --no-restore for a brand new state.


CLI Command Reference

mpx                              # Start or attach to default session
mpx ls                           # List sessions (tmux ls)
mpx list-panes                   # List panes with ids (%N) and status
mpx rename-session -t 0 dev      # Rename session (tmux rename-session)
mpx run --pty -- htop            # Run interactive command in PTY
mpx split -h -d -- htop          # Split side by side without focus (tmux flags)
mpx logs --plain --tail 50 <name> # Rendered scrollback
mpx send-keys -t %1 C-c          # tmux key names
mpx attach -r                   # Read-only: keys and paste stay out of the panes
mpx attach -d                    # Detach the session's other clients first
mpx attach -x                    # As -d, and SIGHUP their parent shells (Unix)
mpx list-clients                 # Attached clients across sessions (tmux list-clients)
mpx detach-client -t CLIENT      # Detach one client (-a: the others of its session)
mpx refresh-client -C 120x40     # Redraw a client, giving it a size (tmux refresh-client)
mpx switch-client -t SESSION     # Switch a client to another session (-l, -n, -p)
mpx link-window --source 0 -t 3  # Show window 0 at index 3 as well (-a, -b, -k, -d)
mpx unlink-window -t 3           # Remove one index (the last needs -k)
mpx resize-window -x 100 -y 30   # Give a window its own size (-A, -a, -L/-R/-U/-D)
mpx new-session -t GROUP         # Refused: each session owns its panes in its own daemon
mpx paste -t %1 --submit "text"  # Bracketed paste + Enter
mpx capture-pane -p -S - -t %1   # Scrollback and screen as text
mpx set-buffer -b notes "text"   # Paste buffers, shared by the CLI and the TUI
mpx paste-buffer -b notes -t %1  # Paste a buffer into a pane
mpx setenv API_URL http://x      # Environment for panes started afterwards
mpx wait <name> --match 'done' --timeout 60
mpx restore                      # Restore workspace from last snapshot
mpx import-tmux [FILE]           # Print a config.toml fragment converted from tmux.conf (writes nothing)
mpx run-shell -b 'touch /tmp/x'  # Run a shell command in the session (-b: do not wait)
mpx if-shell -F '#{pane_active}' 'split-window -h' # Run the command the condition chooses
mpx wait-for -S ready           # Signal a channel (wait-for ready waits for it)
mpx set-hook -a after-new-window 'run-shell ...' # Hooks: set, -u removes, -R runs now
mpx show-hooks                  # List every hook command
mpx kill-server                  # Stop the session daemon