Skip to main content
GUI events are emitted by WezTerm’s graphical user interface layer during application startup and attachment to domains. These events allow you to customize the initial state of your terminal environment.

gui-startup

Since: 20220624-141144-bd1b7c5d Emitted once when the GUI server starts up (when running wezterm start).

Timing

  • Fires before any default program is started
  • Fires before gui-attached event
  • Does NOT fire for wezterm connect invocations
  • If this event creates panes, they take precedence over default program configuration

Event Signature

SpawnCommand | nil
Optional spawn command from wezterm start arguments. Added in version 20220807-113146-c2fee766.

Return Value

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

Examples

Split Window into Thirds

Maximize on Startup

Multiple Workspaces

Use Cases

  • Setting up development environments with specific layouts
  • Creating workspace-based configurations
  • Maximizing or positioning windows on startup
  • Auto-starting specific commands or shells

gui-attached

Since: 20230320-124340-559cb7b0 Emitted when the GUI attaches to a domain after startup.

Timing

  • Fires AFTER gui-startup event
  • Fires when using wezterm connect DOMAIN or wezterm start --domain DOMAIN
  • If no domain is specified, the default domain is passed
  • gui-startup does NOT fire when using wezterm connect DOMAIN or wezterm start --domain DOMAIN --attach

Event Signature

MuxDomain
The multiplexer domain that was attached. Provides information about the domain type and configuration.

Return Value

No return value expected.

Examples

Maximize All Windows on Attach

Domain-Specific Setup

Log Domain Information

Use Cases

  • Maximizing windows when connecting to remote domains
  • Setting domain-specific visual themes or configurations
  • Logging connection information
  • Adjusting workspace layouts based on domain type

Comparison: gui-startup vs gui-attached

Common Patterns

Project-Specific Layouts

Conditional Window Positioning

See Also