micromux

The terminal UI

On this page

Running micromux with no subcommand opens the TUI for the current project. It’s the primary way to watch and steer a stack.

The micromux TUI: a service sidebar beside a log pane The micromux TUI: a service sidebar beside a log pane
The service sidebar (left) and the selected service’s live logs (right).

Layout#

  • Sidebar — every service, one row each, showing its lifecycle state: pending, blocked, starting, running, healthy, unhealthy, exited, or disabled. A job shows COMPLETED once it exited with status 0, grayed out like a disabled service, FAILED with its exit code in red, RETRYING between attempts, and IDLE while a manual job waits to be run. A service whose start waits for a shared resource another session holds shows QUEUED until the session gets it. The selected row drives the panes on the right.
  • Log pane — the selected service’s live output, annotated with the lifecycle transitions that stall it. ANSI color and interactive/redrawing output are supported. A switches it to every service’s logs in time order.
  • Healthcheck pane — toggled with H, it shows the selected service’s latest probe: the command, its exit status, and its output.
  • Events pane — toggled with E in the healthcheck pane’s place, it shows the selected service’s lifecycle events: why it is blocked, restarting, or gone.

The pane with the focus, which the movement keys act on, has a thick frame in an accent color; Tab or a click moves it. The thickness tells it apart even where the terminal shows no color.

Keybindings#

The header’s right side lists the view keys, which change only what the panes show, with their current state. With routes, the Logs pane’s title lists the browser URLs of the selected service, the routes whose port is in its ports list, as many as fit, then a count of the rest; the header says so in red when the shared proxy does not serve them right now. The footer lists the keys that move around and act on services. Both wrap onto extra rows when the terminal is too narrow.

The services list, combined-log tags, and service popups show each service’s configured name, or its ID when no name is set. The i popup also shows the ID when it differs from the display name; commands and control requests always use that ID.

KeyAction
j / k, ↓ / ↑Move the selection
rRestart the selected service, or run the selected job again
RRestart all services
dDisable / enable the selected service
aEnter PTY input mode — send keystrokes to the service (exit with Ctrl+])
TabMove focus between panes
HToggle the healthcheck pane
EToggle the lifecycle events pane (see Lifecycle events)
AToggle every service’s logs in one pane, in time order (see All services’ logs)
wToggle log wrapping
tToggle follow-tail (stick to the newest logs)
/Search the logs the log pane shows (see Searching logs)
n / NMove to the next older / newer search match
LPick the selected service’s log level threshold (ALL, DEBUG, INFO, WARN, ERROR)
TToggle timestamps on the selected service’s structured JSON log lines
FToggle the selected service’s fields that logs.fields hides
iShow everything about the selected service: URLs, ports by variable, command, directory, dependencies, restart and stop policy, the last healthcheck, the current run, and the last cleanup (close with i or Esc)
uShow the session: its domain, the proxy port, every route with its port and service, the allocated ports, and each shared resource the session uses with its holder and queue (close with u or Esc)
?Show every key binding (close with Esc)
mToggle mouse capture (see Mouse)
Ctrl-ZSuspend to the shell; fg brings the TUI back
y / EnterCopy the mouse selection; so do a right-click and the terminal’s copy shortcut (see Copying)
EscClear the mouse selection, or else the search
qQuit. Ctrl-C never quits, so a stray one cannot stop the session; the footer only says to press q. To stop micromux from outside, send it SIGINT or SIGTERM
The service details popup over the log pane, listing the api service's state, URL, ports, command, directory, dependencies, restart and stop policy, last healthcheck, and current run The service details popup over the log pane, listing the api service's state, URL, ports, command, directory, dependencies, restart and stop policy, last healthcheck, and current run
i describes the selected service in full; u shows the session’s routes and ports the same way.

Ctrl-Z gives the terminal back and stops micromux as the shell would stop any foreground job, together with whatever started it in the same job, such as cargo run or a task runner. Until you resume it with fg, micromux supervises nothing: the services keep running, but their output piles up unread until they block on it, healthchecks and restart policies pause, agents talking to the session get no answer, and after about 15 seconds the shared proxy drops the session’s routes, so its *.localhost URLs stop answering until micromux continues.

Restart, disable, and enable all go through the control plane, so they respect dependency gating and restart policy. When the session refuses one, such as a start of a service whose resource another session holds, the header shows why in red until a later command is accepted. It leads with the micromux ctl reserve command that queues for the resource; the holder follows when the terminal is wide enough, and the session overview (u) always shows it.

Shared resources#

A service that names a shared resource gets a gray note under its name in the sidebar, whichever service is selected: until when this session’s turn with the resource is protected and how many sessions wait for it, or which session holds it. A start that waits for the resource shows QUEUED and its place in the queue on a row of its own.

While such a service is selected, a Reservation pane above the logs details it: the holder, since when it holds the resource and until when its turn is protected, this session’s place, the queue in order, and the holder’s reason. i adds each session’s worktree and every waiter’s reason. The pane takes its rows from the logs only while it shows.

The E2E browser service running with a note under its name saying until when its turn is protected, and the reservation pane above the logs naming this session as the holder with an empty queue The E2E browser service running with a note under its name saying until when its turn is protected, and the reservation pane above the logs naming this session as the holder with an empty queue
This session holds the shared browser: the note says until when its turn is protected.
The E2E browser service queued, with the notes held by payments-fix and 1/1 in queue, and the reservation pane naming payments-fix as the holder with its reason The E2E browser service queued, with the notes held by payments-fix and 1/1 in queue, and the reservation pane naming payments-fix as the holder with its reason
Another worktree holds it: enabling the service queues it, and it starts once its turn comes.

Searching logs#

/ opens a prompt over the footer’s last row: type a query and press Enter to search the logs the log pane shows, the selected service’s or every service’s, or Esc to cancel; Backspace edits it. The query matches literal text, the way the pane shows it, and ignores case unless it has an uppercase letter, as vim’s smartcase does: error finds ERROR too, Error finds only Error.

The newest lines are at the bottom, so a search goes back in time, like vim’s ?: Enter moves to the newest match at or above the bottom of the view, n to the next older match and N to the next newer one, wrapping around at either end. A match off screen scrolls to the middle of the pane, and follow-tail stops, so the match stays put while new lines arrive; t follows the tail again. Every match on screen is highlighted, the current one in the focus color, and the Logs pane’s top-right corner shows the query with the current match’s place, such as /error 3/17, or no match.

The search stays while the log moves on: new lines are searched as they arrive, and the current match stays on its line until that line is dropped from the log. Selecting another service searches its logs for the same query, with no match current until n or N moves to one. Esc ends the search and its highlighting, once any mouse selection is cleared. In PTY input mode /, n and N go to the service like any other key. Without wrapping (w), a match past the pane’s right edge is not visible.

All services’ logs#

A shows the logs of every service in the log pane, interleaved in time order, so a request can be followed from one service to the next; A again shows the selected service’s logs. Each line starts with the name of its service, in a color of its own and padded to the longest name, so the log text lines up; a name longer than 16 columns is cut short in the middle, so payments-service-api and payments-service-worker stay apart. The header shows All:ON while the pane shows them.

  • Order. Lines are ordered by when micromux first captured them, one clock for every service, even for lines that carry no timestamp of their own. Lines captured in the same millisecond go in the order of their service names, and each service’s lines keep their own order. The MCP tool follow_all_logs merges the same way, except that it goes by a JSON record’s own timestamp where it has one.
  • Filters. Each service’s lines look as they do in its own pane: its level threshold (L), timestamps (T) and hidden fields (F) apply here too. Those keys still act on the selected service.
  • Live screens. A program that redraws its screen in place, such as a progress bar or a full-screen dashboard, shows as one block of lines, each tagged, that redraws where its first frame appeared, so other services’ newer lines keep coming below it.
  • Everything else works as in a single service’s pane: scrolling and follow-tail, wrapping, search with /, n and N, which also matches the service names, and selecting and copying with the mouse, which copies the names too. A view off the tail stays on its lines while services drop their oldest ones. Switching between the views follows the newest lines.
  • Input. a still types into the selected service; the pane shows that service’s logs while PTY input mode lasts, so you see what you type, and every service’s logs again once Ctrl+] leaves it.

Only the lines that the services still keep in memory show, as in their own panes, so memory stays within each service’s log retention. A busy service drops its oldest lines sooner than a quiet one, so far back in the pane its lines may be missing.

Lifecycle events#

E shows the selected service’s lifecycle events beside the logs, the timeline agents read with the MCP tool get_service_events: restart, enable and disable requests, config reloads, spawns and exits, healthcheck changes, restart backoff, dependency waits and failures, cleanups, discarded terminal input, and the creation, replacement, lease renewal and retirement of dynamic services. Each line shows the local time, the kind of event and what happened, such as 12:04:31 backoff automatic restart scheduled after 2000 ms. The kind is red for a failure, yellow while the service waits or when input was lost, green for progress, and blue for a request or a configuration change.

The newest event is at the bottom, and the pane follows it as the log pane follows its tail; scrolling, wrapping and copying work as in the other panes, and a selection stays on its events while older ones drop out. It shows the events the session keeps, the latest 256 per service. An attached TUI keeps a copy of every service’s events, as it does of their logs and healthchecks, and fetches only the new ones over the connection.

The events pane and the healthcheck pane take turns beside the logs, so the logs and the service terminals keep the same width with either: E replaces the healthcheck pane, H brings it back, and the key of the pane on screen hides it. The header’s H/E Pane hint names the pane on screen, HEALTH or EVENTS, or says OFF. The pane follows the selected service, also while A shows every service’s logs. An attached TUI shows the session’s events too; a session too old to report them says so.

Mouse#

With mouse capture on, which is the default, the mouse works as in most terminal apps:

  • Click a service to select it, or any pane to focus it, as Tab would.
  • Wheel scrolls the pane under the pointer, without moving the focus: each notch moves the service list’s selection by one service, and the log, healthcheck and events panes by three rows, also where the terminal sends a burst of events for one notch. A high-resolution wheel or a touchpad moves at most a step every 15 milliseconds. Scrolling up leaves follow-tail, as the keys do, but only when the view moves; a pane whose text fits, such as a full-screen program’s live screen, keeps following. Scrolling back to the bottom follows the tail again. While a popup is open, the wheel scrolls the popup.
  • Drag selects text inside the pane where the drag started, never across panes, so a selection in the logs never picks up the sidebar. A service’s name in the list and each URL in the Logs pane’s title select the same way, each on its own, so a selection there never takes in the status beside the name or the title around the URL, and a drag past their edges scrolls nothing. Dragging past the top or bottom of the pane scrolls it, and past its right edge selects to the end of the line, even where a line runs on beyond the pane. A double click selects a word, a triple click the whole line, even when it wraps over several rows or runs past the pane. A character two cells wide, such as one of Chinese or Japanese text, is selected whole from either of its cells. Esc clears the selection.
  • The selection stays on its text until you clear it or start another: while new lines arrive and the pane scrolls, while a busy log drops its oldest lines, and while a live screen or a popup redraws. A resize keeps it too, unless wrapping lays the text out anew. A selection in a service’s name, which takes only what its row shows of a name the list cuts short, goes once the row shows another service, another name or less of it, and one in a URL goes once the title no longer shows that URL in its place, as when another service is selected.
  • Selecting only highlights. Press y or Enter, right-click anywhere, or click y Copy in the footer, which takes the mouse toggle’s place while text is selected, to copy the selection to the clipboard. The terminal’s own copy shortcut can copy too, as Copying describes. A right-click copies when the button comes up and changes nothing else: not the selection, the focus or the selected service; without a selection it does nothing. A right-click on a URL in the Logs pane’s title copies that URL instead, as described below. To copy as soon as a drag ends instead, turn on ui.copy_on_select.
  • Copying goes to the clipboard, and to the primary selection where there is one, through the terminal’s OSC 52 support, which also works over ssh. The footer says what was copied for a few seconds: beside its hints where they leave room, and otherwise in the place of the copy or mouse hint, which reads y Copied, Copied or URL copied at its own width, so no other hint moves; the search prompt, which takes the footer’s last row while it is open, can hide it there. Some terminals ignore OSC 52, such as macOS Terminal and GNOME Terminal and other VTE-based terminals, so outside ssh micromux also hands the text to pbcopy on macOS, or to wl-copy, xclip or xsel on Linux, whichever is installed. On GNOME under Wayland, xclip and xsel go before wl-copy, which would flash a window in the dock there, since GNOME gives no clipboard to a program without one. Where neither works, use the terminal’s own selection, described below.
  • Click a key hint in the header or footer to run its key, such as ? for help. It acts when the button comes up on the hint it went down on, so sliding off cancels it. The q hint does nothing, so a stray click never ends the session, and neither do hints that name two keys, like ↑/↓, except H/E, which shows the healthcheck pane, then the events pane, then neither.
  • Click a URL in the Logs pane’s title to open it in your browser, or right-click it to copy it, which also works over ssh, where micromux cannot open a browser. The right-click copies when the button comes up on the URL it went down on, so sliding off copies nothing, and it leaves any selection as it is. A drag along a URL selects it without opening it, and a quick second click selects the URL the first one opened. When micromux cannot start a browser for it, as over ssh, or the opener (xdg-open on Linux, open on macOS) reports an error within a few seconds, as where no browser is set up, the footer says so in red for a few seconds. An opener that fails without reporting it, and Windows’ explorer, which reports an error even when it opens the URL, are beyond what micromux sees.
  • Click outside an open popup to close it, as Esc does. In the level picker, click the threshold you want.

ui.mouse can leave out any of these, such as every click but those that select and copy text.

In PTY input mode, neither clicks nor the wheel change which service receives your keystrokes, a right-click copies nothing, and y, Enter, Ctrl-C and the copy shortcuts go to the service, as the bytes a terminal without the kitty keyboard protocol sends for them; leave the mode with Ctrl+] to copy.

Four request lines of the api service's logs highlighted by a mouse drag, with the footer offering y to copy them Four request lines of the api service's logs highlighted by a mouse drag, with the footer offering y to copy them
A drag selects lines inside the logs pane only, and y copies them.

Copying#

Besides y, Enter, a right-click and the footer’s y Copy, micromux copies the selection on the shortcuts terminals copy with: Ctrl+Shift+C and Ctrl+Insert, as on Linux and Windows, and Super+C, which is Cmd+C on macOS. A plain Ctrl-C never copies.

Two things stand between these shortcuts and micromux:

  • The terminal consumes its copy shortcut, as long as it is bound, even when it has nothing selected, which under mouse capture it never has. To let it through when the terminal has no selection of its own, mark the binding performable: in Ghostty’s config:

    ~/.config/ghostty/config
    keybind = performable:ctrl+shift+c=copy_to_clipboard:mixed
    keybind = performable:super+c=copy_to_clipboard:mixed

    In WezTerm, a Lua action_callback can copy when window:get_selection_text_for_pane(pane) returns text and otherwise pass the key on with window:perform_action(act.SendKey { key = 'c', mods = 'CTRL|SHIFT' }, pane). Where a terminal cannot pass the shortcut on, Ctrl+Insert, which few terminals bind, a right-click and y still copy.

  • The kitty keyboard protocol tells Ctrl+Shift+C from Ctrl-C. Without it, terminals send both as the same byte, and Super never reaches programs at all. micromux turns the protocol on wherever the terminal supports it, as Ghostty, kitty, WezTerm, foot and Alacritty do, and turns it off again whenever it lets go of the terminal. In a terminal without it, a copy shortcut passed on to programs arrives as Ctrl-C; that is the terminal’s doing, not micromux’s, and micromux then only says to press q to quit. tmux has no kitty protocol either, but it can report Ctrl+Shift+C apart in its own way, with these lines in its config:

    ~/.tmux.conf
    set -s extended-keys on
    set -s extended-keys-format csi-u
    set -as terminal-features '*:extkeys'

    With them, micromux asks tmux for these reports (xterm’s modifyOtherKeys) and resets the request whenever it lets go of the terminal. The last line has tmux ask the terminal around it to send Ctrl+Shift+C apart in turn, which tmux only does for terminals it knows to support it. tmux’s default extended-keys-format xterm sends a form micromux cannot read, so there micromux asks for nothing, and Ctrl+Shift+C arrives as Ctrl-C; Ctrl+Insert, a right-click and y still copy. The terminal around tmux needs its copy shortcut passed on too, as above.

To see what micromux receives, start it with MICROMUX_DEBUG_KEYS=1: its log, ~/.cache/micromux/micromux.log.<date> on Linux, ~/Library/Caches/com.romnn.micromux/micromux.log.<date> on macOS, or the file --log-file names, then records whether the terminal has the protocol, what tmux said, and every key as micromux reads it; in PTY input mode it leaves out which character was typed, so a password typed into a service stays out of the log.

A service in PTY input mode never asked for the protocol, so micromux turns it, and modifyOtherKeys in tmux, off while the mode lasts, so Ctrl chords reach the service as the terminal’s own bytes on any keyboard layout. As in any terminal without the protocol, Alt+O and Alt+[ start an escape sequence and Alt+Esc arrives as a plain Esc there. Ctrl+], which every terminal sends apart, leaves the mode, and the protocol comes back on. Outside PTY input mode one limit remains: on a non-Latin keyboard layout, such as Russian or Greek, the protocol reports Ctrl chords as the layout’s letter, so Ctrl-C and Ctrl-Z do not reach micromux as such; switch to a Latin layout for them.

Using the terminal’s own mouse handling#

Mouse capture keeps the terminal from seeing the mouse. To use your terminal’s own selection or link clicking for a moment, hold its bypass modifier while you click or drag: Shift in most terminals, including GNOME Terminal, Konsole, kitty, Alacritty, WezTerm, foot, Ghostty and Windows Terminal, and Option in iTerm2. macOS Terminal switches mouse reporting off and on with View › Allow Mouse Reporting. Inside tmux with mouse on, Shift also bypasses tmux.

Press m to turn capture off or on while the TUI runs; the footer shows Mouse:ON or Mouse:OFF. Capture comes back with what ui.mouse lets the mouse do, or with everything where it turns every part off. With capture off, the terminal behaves exactly as without micromux: micromux sends it no mouse sequences, and nothing in the TUI reacts to the mouse.

Settings#

Two settings shape the mouse:

SettingFlag and environment variableDefaultEffect
ui.mouse--mouse on|off, MICROMUX_MOUSEonWhat the mouse may do: true or false for everything, or its parts.
ui.copy_on_select--copy-on-select on|off, MICROMUX_COPY_ON_SELECToffCopy a selection as soon as the drag ends, without waiting for y.

For each, and for each part of ui.mouse on its own, the first of these that says wins:

  1. The flag or its environment variable, for one run. They also apply to micromux attach.
  2. The ui section of the project’s micromux.yaml.
  3. The ui section of your user config, for every project.
  4. The default.

A project setting wins over your own because it describes something about that project, such as a team that copies a lot of log output with the terminal’s selection; your user config is the default for projects that do not care.

Mouse parts#

ui.mouse also takes the parts of the mouse to turn on or off:

ui:
  mouse:
    select: true    # a drag, double or triple click selects text in one pane; y, Enter, a right click or y Copy copies it; a right click on a URL copies the URL
    navigate: false # a click focuses panes, selects services, presses key hints, opens URLs and picks levels
    scroll: true    # the wheel scrolls the pane, list or popup under the pointer

A part left out comes from the next setting down, and is on where none sets it, so mouse: { navigate: false } keeps selecting and scrolling. mouse: true and mouse: false set every part, and so does --mouse. micromux captures the mouse when any part is on.

Without navigate, a press on a service’s name, in the logs or in a side pane still starts a selection there but neither focuses the pane nor selects a service, and of the hints and URLs only the y Copy hint reacts to a click, though a right-click on a URL still copies it. A press outside a popup still closes it, so a popup cannot trap the pointer. The wheel over the services list moves the selected service as part of scroll.

micromux releases the mouse, and the kitty keyboard protocol, whenever it lets go of the terminal: when it exits, however it is asked to, when you press Ctrl-Z, and when it panics. A stop signal sent from outside, such as kill -TSTP or kill -STOP, gives micromux no chance to let go first, but when it continues it takes the terminal over afresh and redraws.

User config#

Settings that are about you rather than a project live in your user config, config.yaml in micromux’s config directory:

PlatformPath
Linux and macOS$XDG_CONFIG_HOME/micromux/config.yaml, by default ~/.config/micromux/config.yaml
Windows%APPDATA%\romnn\micromux\config\config.yaml

It uses the same keys as a project’s micromux.yaml, and holds only the mouse settings for now:

ui:
  mouse: true
  copy_on_select: false

The file is optional. Unknown keys produce a warning, so a file written for a newer micromux still loads.

Filtering structured logs#

For services that emit JSON logs, the log pane can show less than the service emits without losing anything:

  • Level threshold — L opens a picker for the selected service. Structured records below the chosen level are hidden; lines without a recognizable level, such as build output and panics, always show. The initial threshold comes from logs.level.
  • Timestamps — T toggles a local-time timestamp at the start of each structured line of the selected service. Records without their own timestamp show when micromux captured them. The initial state comes from logs.timestamps.
  • Hidden fields — F shows or hides the fields that logs.fields hides for the selected service. The initial state comes from logs.filter_fields.

The logs pane’s top-right corner names any active filter, such as level ≥ INFO · 4 fields hidden. These settings only shape the display: micromux ctl logs and the MCP log tools always return every record and field.

Structured JSON log lines led by their timestamps, with the pane's top-right corner reading 4 fields hidden Structured JSON log lines led by their timestamps, with the pane's top-right corner reading 4 fields hidden
A service’s JSON logs with timestamps, minus the source location and span fields its config hides.

Sending input to a service#

Some processes want input — a REPL, a prompt, a dev server waiting on a keypress. Press a to enter input mode: keystrokes are forwarded to the selected service’s PTY until you leave input mode with Ctrl+].

A Ctrl-Z typed in input mode can suspend the service, whose process group is the terminal’s foreground group; restart the service to recover it.

Disabling on the fly#

Press d to disable the selected service: micromux stops it and its row turns gray, while its captured logs remain for inspection. The log pane turns gray with it: every color becomes your theme’s light or dark gray by its brightness, so a progress bar or a highlighted row keeps its shape while nothing looks live. Press d again to re-enable and start it.

Those preserved logs would otherwise look frozen, so micromux marks each transition in the log with a blue rule — === service disable requested ===, === service enable requested ===, === waiting for postgres to become healthy ===, === automatic restart scheduled after 250 ms ===. Whatever the log is doing, the last line says why. The same rules appear in micromux ctl logs and in the retained run files; the MCP log tools strip their color along with the rest of the ANSI.

A disabled service, stopped with its row grayed out A disabled service, stopped with its row grayed out
A disabled service — stopped, grayed out, its logs preserved in gray.

Attach to a running session#

When a session is running headless — started by an agent via micromux serve, or by start_session over MCP — open the same TUI against it without launching a second supervisor:

micromux attach                          # the session for the config resolved from the cwd
micromux attach --config ./micromux.yaml
micromux attach --session name:my-project

A selector may be a bare session name or name:, pid:, or hash:. More than one attach client can observe and operate the same session at once.

An attached TUI follows service status, logs, and healthchecks, and its lifecycle keys (r, R, d) still restart, enable, and disable services. a types into the selected service as it does locally, so an interactive service of a headless session can be driven from an attached TUI.

With several clients on one session, the last active writer wins:

  • Resizes. Watching never resizes anything: an attached TUI resizes the service PTYs only while it is in PTY input mode, starting with its own size when you press a, and following its log pane while the mode lasts. The session’s own TUI resizes them whenever its log pane changes size, and takes the size back when you press a there. Every PTY takes the size of the most recent resize the session receives. Detaching does not restore an earlier size.
  • Input. Keystrokes and pastes from every client reach the service in the order the session receives them, with no lock or turn-taking, like two terminals typing into one tmux pane. Each client’s input stays in its own order, and one batch of keys or one paste is written whole, never split by another client’s. Input typed while an attached TUI shows reconnecting… is discarded rather than sent later, and input for a service that is not running is refused with a notice.

An attached paste is limited to 512 KiB, half the local limit, so it fits one control-protocol message. A session older than micromux’s protocol 3.18 accepts no input or resizes; a is then unavailable.

Note

Pressing q in an attached client only detaches it — it never stops the session or its services. To stop a headless session explicitly, use micromux ctl stop or the MCP stop_session tool.

Esc

Type # for headings only ↑↓ move ↵ open Ctrl ↵ new tab Ctrl U/D scroll preview

Keyboard shortcuts

/ ⌘ K Ctrl K
Search
← →
Previous or next page
?
Show these shortcuts