gui-attached¶
Since: Version 20230320-124340-559cb7b0
The functionality described in this section requires version 20230320-124340-559cb7b0 of wakterm, or a more recent version.
This event is triggered when the GUI is starting up after attaching the
selected domain. For example, when you use wakterm connect DOMAIN or
wakterm start --domain DOMAIN to start the GUI, the gui-attached event will
be triggered and passed the MuxDomain object
associated with DOMAIN. In cases where you don't specify the domain, the
default domain will be passed instead.
This event fires after the gui-startup event.
Note that the gui-startup event does not fire when invoking wakterm connect
DOMAIN or wakterm start --domain DOMAIN --attach.
You can use this opportunity to take whatever action suits your purpose; some users like to maximize all of their windows on startup, and this event would allow you do that:
local wakterm = require 'wakterm'
local mux = wakterm.mux
wakterm.on('gui-attached', function(domain)
-- maximize all displayed windows on startup
local workspace = mux.get_active_workspace()
for _, window in ipairs(mux.all_windows()) do
if window:get_workspace() == workspace then
window:gui_window():maximize()
end
end
end)
local config = wakterm.config_builder()
return config
See also: gui-startup.