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-startupevent - 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 IDname- Process namestatus- Process status (e.g., “Sleep”, “Running”)argv- Array of command-line argumentsexecutable- Full path to executablecwd- Current working directorychildren- 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
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:wezterm connect DOMAIN:
Common Patterns
Daemon Mode Setup
Combining mux-startup with gui-startup
See Also
- gui-startup - GUI initialization event
- MuxWindow object - Multiplexer window API
- MuxTab object - Multiplexer tab API
- Pane object - Pane API and information