Multiplexer Sessions

Normally every pane lives inside the Nash application. When Nash exits, the shells and the programs in them exit too. Session Restore brings the layout back, but the programs start again in new shells.

The multiplexer keeps the programs themselves alive. In multiplexer mode, a headless server owns your panes. A Nash window is only a view onto that server. Closing the window, quitting Nash, and updating Nash do not stop your panes.

If you use tmux or screen to keep work running, this is the Nash version of that idea, built into the terminal.

Multiplexer sessions need Nash 0.5.6 or newer.

The pieces

PieceWhat it is
nash-mux-serverA headless process that owns panes. Panes survive the Nash window.
SessionA named workspace inside the server. It is the equivalent of a tmux session.
DomainThe connection to a server. nash mux --domain <name> selects one.

A session holds windows, a window holds tabs, and a tab holds panes. The server starts on demand, so you do not start it yourself.

Turn it on

Multiplexer mode ships disabled. Edit the [mux] table in nash.toml:

[mux] enabled = true domain = "mux" default_session = "default" connect_automatically = true
KeyDefaultWhat it does
enabledfalseMakes the multiplexer the default home for new panes.
domain"mux"The name of the unix domain. nash mux --domain <name> uses it too.
default_session"default"The session that a fresh start uses.
connect_automaticallytrueAttaches the domain when Nash starts.

With enabled = true, Nash attaches the domain at startup and puts every new tab in it. Your panes then survive closing a window, quitting Nash, and updating the application. Restart Nash after you change the setting.

With connect_automatically = false, Nash does not attach the domain at startup. Run nash connect mux to attach it by hand.

With enabled = false, every pane stays inside the Nash application. The built-in local domain stays available in both modes, so a task that must not depend on the server can still spawn there.

If your nash.toml has no [mux] table, run nash config sync to add the table that your build ships. See Keep your configuration in step.

Reach your panes again

After you close a window or quit Nash, the panes keep running in the server. Show a session again with either of these:

nash mux connect default

or choose Switch Session from the command palette.

nash mux connect <session> behaves like tmux new -A -s <session>. It creates the session if it does not exist, asks a running Nash to show it, and opens a new window if no Nash is running. The full command list is on the Multiplexer Commands page.

Sessions in the command palette

The command palette has three session commands, in the Window menu:

CommandWhat it does
Switch SessionPick a session and show it in this window.
New SessionAsk for a name, create the session, and switch to it.
Rename SessionRename the session that this window shows.

These commands work on workspaces, so they are also useful when [mux].enabled = false. Only the server makes a session outlive the application.

Folded panes and the multiplexer

Folded panes survive a multiplexer reconnect. The fold state travels over the connection between the window and the server.

Multiplexer or session restore?

Session RestoreMultiplexer
Layout comes backYesYes
Running programs keep goingNo, Nash starts new shellsYes
Needs a settingNoYes, [mux].enabled = true
Survives a machine restartThe layout doesNo, the server stops

You can use both. Read the note about duplicate panes in Limits and Troubleshooting before you do.