Skip to main content
Multiplexer (mux) events are emitted by WezTerm’s multiplexer layer, which manages terminal sessions, panes, tabs, and windows. These events allow you to customize multiplexer behavior and startup.

mux-startup

Since: 20220624-141144-bd1b7c5d Emitted once when the mux server starts up.

Timing

  • Fires before any default program is started
  • Fires BEFORE gui-startup event
  • If this event creates panes, they take precedence over default program configuration
  • Fires in both local and remote (daemon) mode

Event Signature

Return Value

No return value expected. This is a fire-and-forget event.

Examples

Basic Window Split

Multi-Pane Development Layout

Workspace Initialization

Use Cases

  • Setting up consistent terminal layouts
  • Creating default workspaces
  • Initializing multiplexer-only sessions (daemon mode)
  • Pre-configuring pane arrangements before GUI attachment

mux-is-process-stateful

Since: 20220101-133340-7edc5b5a Emitted when the multiplexer needs to determine if a pane can be closed without prompting.

Characteristics

  • Synchronous event - Must return quickly to avoid blocking
  • Called before closing a pane to check if confirmation is needed
  • Allows custom logic beyond the default process name matching

Event Signature

LocalProcessInfo
Process information object containing details about the process tree in the pane.Fields:
  • pid - Process ID
  • name - Process name
  • status - Process status (e.g., “Sleep”, “Running”)
  • argv - Array of command-line arguments
  • executable - Full path to executable
  • cwd - Current working directory
  • children - Table of child processes (keyed by PID)

Return Values

boolean
Process is stateful - prompt user before closing
boolean
Process is not stateful - close without prompting
nil
Use default behavior (check skip_close_confirmation_for_processes_named config)

Examples

Log Process Tree

Example Output:

Custom Stateful Process Detection

Directory-Based Detection

Long-Running Process Detection

Use Cases

  • Custom logic for determining important processes
  • Protecting specific workflows or directories
  • Integration with project-specific tools
  • Preventing accidental closure of development environments

Event Ordering

When WezTerm starts, multiplexer events fire first:
For wezterm connect DOMAIN:

Common Patterns

Daemon Mode Setup

Combining mux-startup with gui-startup

See Also