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.
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
| Shortcut | Action | Description |
|---|---|---|
Ctrl-Space | Command Palette | Instant fuzzy search across sessions, windows, panes, commands, and key bindings (no prefix required) |
Prefix < / Prefix > | display-menu | Window 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 + c | New Window | Create a new window tab in current directory |
Prefix + % / | | Split Vertical | Split active pane side by side |
Prefix + " / - | Split Horizontal | Split active pane top / bottom |
Prefix + h j k l | Focus Directional | Move focus left, down, up, or right to the adjoining pane you used most recently; wraps at the window's edge |
Prefix + z | Toggle Zoom | Zoom active pane to fill 100% of terminal, or unzoom |
Prefix + x | Kill Pane | Close active pane (prompts for confirmation); focus returns to the pane you used last |
Prefix + & | Kill Window | Close active window tab and all child panes |
Prefix + [ | Copy Mode | Enter 100k-line Vi scrollback mode with visual selection and regex search |
Prefix + s | Choose Session | Interactive session and pane chooser |
Prefix + w | Choose Window | Interactive window and pane chooser |
Prefix + $ | Rename Session | Rename the current session |
Prefix + , | Rename Window | Rename the active window tab |
Prefix + ( ) | Switch Session | Previous / next session |
Prefix + : | Command Prompt | tmux commands with vim aliases (:vsplit, :tabnew, :q) |
Prefix + ? | Key List | Searchable list of every binding |
Mouse Mode
- Left Click: Focus clicked pane immediately.
- Drag a Border: Resize the panes on either side of it.
- Left Drag: Select text from the press point; release copies it to clipboard and leaves copy mode.
- Scroll Wheel: Enter copy mode and scroll through the history of the pane under the pointer, without moving focus.
- Middle Click: Focus the clicked pane and paste the top paste buffer into it.
- Right Click a Pane: Menu of pane commands: split, swap, kill, respawn, mark, zoom, disable or enable input, break out.
- Right Click a Window Tab: Menu of window commands: rename, kill, respawn, new window.
- Right Click the Session Name: Menu of session commands: next and previous session, new window, choose tree, detach.
- Right Click a Split Border: Menu of layouts: even, main, tiled, spread out.
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
| Option | Type | Default | Scope | Description |
|---|---|---|---|---|
prefix | string | "C-b" | TUI | Prefix key in tmux notation. Press twice to send literal prefix key to pane. |
remain_on_exit | true, false or "failed" | false | Daemon | Keep panes open after their child process terminates; "failed" keeps only panes that exited non-zero. |
history_limit | integer | 64 | Daemon | Number of dead/removed panes retained in log buffer for CLI queries. |
allow_passthrough | true, false or "all" | true | TUI | Terminal 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_lines | integer | 100000 | Daemon | Lines 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_rename | bool | true | Daemon | Name windows after their foreground process; false keeps the creation name. |
monitor_activity | bool | true | Daemon | Flag background windows that print output. |
monitor_bell | bool | true | Daemon | Flag background windows that ring the bell. |
monitor_silence | integer (seconds) | 0 | Daemon | Flag a background window once it has printed nothing for this many seconds; 0 is off. |
renumber_windows | bool | true | Daemon | Closing a window renumbers the windows after it. false keeps each window's number and leaves a gap; move-window -r renumbers them. |
default_terminal | string | "xterm-256color" | Daemon | TERM for panes started afterwards. |
default_shell | string | unset ($SHELL) | Daemon | Program run by a pane started without a command; an absolute path. |
default_command | string | unset | Daemon | Command run through the default shell by a pane started without a command. |
restore | bool | true | Daemon | Automatically 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_ms | integer | 300 | TUI | Milliseconds to wait after prefix before showing shortcut HUD popup (0 = instant). |
display_panes_time_ms | integer | 1000 | TUI | Milliseconds the display-panes numbers stay up (0 = until a key is pressed). |
base_index | integer | 0 | TUI | Number of the first window (tmux base-index): tabs, Prefix digits and #{window_index}. |
pane_base_index | integer | 0 | TUI | Number of the first pane as #{pane_index} shows it (tmux pane-base-index). |
mouse | bool | true | TUI | false turns mouse reporting off and ignores mouse events. |
status | bool | true | TUI | Show the status line; false gives its row to the panes. |
status_lines | integer 1 to 5 | 1 | TUI | Rows the status line takes (tmux status 2 to 5). Rows after the first show status_format. |
status_format | list of strings (tmux format) | empty | TUI | status_format[N] is drawn on status row N. A non-empty entry 0 replaces the main status line. |
status_position | "top" or "bottom" | "bottom" | TUI | Row of the status line. |
status_interval | integer (seconds) | 1 | TUI | Seconds between timed status redraws; 0 redraws only on events. |
status_left, status_right | string (tmux format) | "[#{session_name}] ", "#{?pane_in_mode,[copy] ,}\"#{=21:pane_title}\" %H:%M %d-%b-%y" | TUI | The 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_length | integer | 10, 40 | TUI | Widest a status side may be. |
window_status_format, window_status_current_format, window_status_separator | string | "#I:#W#{window_flags}", same, " " | TUI | Window tab formats and the text between tabs. |
status_justify | "left", "centre" or "right" | "left" | TUI | Where the window list sits between the two sides. |
display_time_ms | integer | 3000 | TUI | Milliseconds a status message stays up (tmux display-time). |
mode_keys | "vi" or "emacs" | "vi" | TUI | Copy-mode key table (tmux mode-keys). |
set_clipboard | bool | true | TUI | false keeps copy-mode yanks off the system clipboard. |
synchronize_panes | bool | false | TUI | Windows 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_style | tmux style string | empty (no change) | TUI | tmux 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_search | bool | true | TUI | false stops copy-mode searches at their first or last match (tmux wrap-search). |
focus_events | bool | false | TUI | Forward 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" | TUI | Modified 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_keys | bool | true | TUI | Function and cursor keys keep their modifiers (tmux xterm-keys). |
set_titles, set_titles_string | bool, format | false, "#S:#I:#W - \"#T\"" | TUI | Outer terminal title from a format (tmux set-titles, set-titles-string). |
bell_action | "none", "any", "current" or "other" | "any" | TUI | Which windows' bells ring the outer terminal (tmux bell-action). |
visual_bell, visual_activity | bool | false, false | TUI | Show bells and window activity on the status row instead of ringing (tmux visual-bell, visual-activity). |
resume | array of tables | defaults | Daemon | Rules 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