@@ -1149,8 +1149,18 @@ local Wezterm = {}
11491149--- Its purpose is to enable you to add additional entries to the list of commands shown in the palette.
11501150---
11511151--- This hook is synchronous; calling asynchronous functions will not succeed.
1152+ ---- --
1153+ --- The `"augment-command-palette"` event is emitted when
1154+ --- the `Command Palette` is shown.
1155+ ---
1156+ --- Its purpose is to enable you to add additional entries
1157+ --- to the list of commands shown in the palette.
1158+ ---
1159+ --- This hook is synchronous; calling asynchronous functions will not succeed.
1160+ ---
1161+ --- The return value is an [`AugmentCommandPaletteReturn`](lua://AugmentCommandPaletteReturn) table.
11521162---
1153- --- @param event AugmentCommandPalette
1163+ --- @param event " augment-command-palette "
11541164--- @param callback AugmentCallbackWindowPane
11551165--- @return AugmentCommandPaletteReturn
11561166function Wezterm .on (event , callback ) end
@@ -1160,7 +1170,15 @@ function Wezterm.on(event, callback) end
11601170--- the pane in which the bell was rung, which may not be active pane;
11611171--- it could be in an unfocused pane or tab
11621172---
1163- --- @param event Bell
1173+ ---- --
1174+ --- The `"bell"` event is emitted when the `ASCII BEL` sequence
1175+ --- is emitted to a pane in the window.
1176+ ---
1177+ --- Defining an event handler doesn't alter wezterm's handling of the bell;
1178+ --- the event supplements it and allows you
1179+ --- to take additional action over the configured behavior.
1180+ ---
1181+ --- @param event " bell"
11641182--- @param callback CallbackWindowPane
11651183function Wezterm .on (event , callback ) end
11661184
@@ -1196,7 +1214,19 @@ function Wezterm.on(event, callback) end
11961214--- it doesn't make sense to define multiple instances of the event
11971215--- with `multiple wezterm.on("format-tab-title", ...)` calls.
11981216---
1199- --- @param event FormatTabTitle
1217+ ---- --
1218+ --- The `"format-tab-title"` event is emitted when the text for a tab title
1219+ --- needs to be recomputed.
1220+ ---
1221+ --- This event is a bit special in that it is synchronous and must return
1222+ --- as quickly as possible in order to avoid blocking the GUI thread.
1223+ ---
1224+ --- The most notable consequence of this is that some functions that are asynchronous
1225+ --- (e.g. `wezterm.run_child_process()`) are not possible to call
1226+ --- from inside the event handler and will generate a
1227+ --- `format-tab-title: runtime error: attempt to yield from outside a coroutine` error.
1228+ ---
1229+ --- @param event " format-tab-title"
12001230--- @param callback fun ( tab : MuxTab , tabs : MuxTab[] , panes : Pane[] , config : Config , hover : boolean , max_width : number ): string | FormatItem
12011231function Wezterm .on (event , callback ) end
12021232
@@ -1227,29 +1257,55 @@ function Wezterm.on(event, callback) end
12271257--- it doesn't make sense to define multiple instances of the event
12281258--- with multiple `wezterm.on("format-window-title", ...)` calls.
12291259---
1230- --- @param event FormatWindowTitle
1260+ ---- --
1261+ --- The `"format-window-title"` event is emitted when the text for the window title
1262+ --- needs to be recomputed.
1263+ ---
1264+ --- This event is a bit special in that it is synchronous and must return
1265+ --- as quickly as possible in order to avoid blocking the GUI thread.
1266+ ---
1267+ --- The most notable consequence of this is that some functions that are asynchronous
1268+ --- (e.g. `wezterm.run_child_process()`) are not possible to call
1269+ --- from inside the event handler and will generate a
1270+ --- `format-window-title: runtime error: attempt to yield from outside a coroutine` error.
1271+ ---
1272+ --- @param event " format-window-title"
12311273--- @param callback fun ( window : Window , pane : Pane , tabs : MuxTab[] , panes : Pane[] , config : Config ): string
12321274function Wezterm .on (event , callback ) end
12331275
1234- --- @param event GuiAttached
1276+ --- @param event " gui-attached "
12351277--- @param callback fun ( domain : ExecDomain )
12361278function Wezterm .on (event , callback ) end
12371279
1238- --- @param event GuiStartup
1280+ --- @param event " gui-startup "
12391281--- @param callback fun ( cmd ?: SpawnCommand )
12401282function Wezterm .on (event , callback ) end
12411283
12421284--- - The first event parameter is a [`Window`](lua://Window) object that represents the GUI window
12431285--- - The second event parameter is a [`Pane`](lua://Pane) object that represents the active pane in the window
12441286---
1245- --- @param event NewTabButtonClick
1287+ ---- --
1288+ --- The `"new-tab-button-click"` event is emitted when the user clicks on the
1289+ --- `"new tab"` button in the tab bar.
1290+ ---
1291+ --- This is the `+` button that is drawn to the right of the last tab.
1292+ ---
1293+ --- @param event " new-tab-button-click"
12461294--- @param callback fun ( window : Window , pane : Pane , button : " Left" | " Middle" | " Right" , default_action : KeyAssignment )
12471295function Wezterm .on (event , callback ) end
12481296
12491297--- - The first event parameter is a [`Window`](lua://Window) object that represents the GUI window
12501298--- - The second event parameter is a [`Pane`](lua://Pane) object that represents the pane
12511299--- - The third event parameter is the URI string
1252- --- @param event OpenUri
1300+ ---
1301+ ---- --
1302+ --- The `"open-uri"` event is emitted when
1303+ --- the `CompleteSelectionOrOpenLinkAtMouseCursor` key/mouse assignment is triggered.
1304+ ---
1305+ --- The default action is to open the active URI in your browser,
1306+ --- but if you register for this event you can co-opt the default behavior.
1307+ ---
1308+ --- @param event " open-uri"
12531309--- @param callback fun ( window : Window , pane : Pane , uri : string )
12541310function Wezterm .on (event , callback ) end
12551311
@@ -1268,7 +1324,11 @@ function Wezterm.on(event, callback) end
12681324--- `wezterm` won't schedule another call until `status_update_interval_milliseconds`
12691325--- have elapsed since the last call completed.
12701326---
1271- --- @param event UpdateRightStatus
1327+ ---- --
1328+ --- The `"update-right-status"` event is emitted periodically
1329+ --- (based on the interval specified by `config.status_update_interval`).
1330+ ---
1331+ --- @param event " update-right-status"
12721332--- @param callback CallbackWindowPane
12731333--- @deprecated
12741334function Wezterm .on (event , callback ) end
@@ -1285,7 +1345,11 @@ function Wezterm.on(event, callback) end
12851345--- `wezterm` won't schedule another call until `status_update_interval` milliseconds
12861346--- have elapsed since the last call completed.
12871347---
1288- --- @param event UpdateStatus
1348+ ---- --
1349+ --- The `"update-status"` event is emitted periodically
1350+ --- (based on the interval specified by the status_update_interval configuration value).
1351+ ---
1352+ --- @param event " update-status"
12891353--- @param callback CallbackWindowPane
12901354function Wezterm .on (event , callback ) end
12911355
@@ -1312,7 +1376,11 @@ function Wezterm.on(event, callback) end
13121376---
13131377--- See `Pane:get_user_vars()`.
13141378---
1315- --- @param event UserVarChanged
1379+ ---- --
1380+ --- The `"user-var-changed"` event is emitted when a _user var escape sequence_
1381+ --- is used to set a user var.
1382+ ---
1383+ --- @param event " user-var-changed"
13161384--- @param callback fun ( window : Window , pane : Pane , name : string , value : string )
13171385function Wezterm .on (event , callback ) end
13181386
@@ -1328,7 +1396,16 @@ function Wezterm.on(event, callback) end
13281396--- - The first event parameter is a [`Window`](lua://Window) object that represents the GUI window
13291397--- - The second event parameter is a [`Pane`](lua://Pane) object that represents the active pane in that window
13301398---
1331- --- @param event WindowConfigReloaded
1399+ ---- --
1400+ --- The `"window-config-reloaded"` event is emitted when the configuration for
1401+ --- a window has been reloaded.
1402+ ---
1403+ --- This can occur when the configuration file is detected as changed
1404+ --- (when `Config.automatically_reload_config` is enabled),
1405+ --- when the configuration is explicitly reloaded via the `ReloadConfiguration` key action,
1406+ --- and when `Window:set_config_overrides()` is called for the window.
1407+ ---
1408+ --- @param event " window-config-reloaded"
13321409--- @param callback CallbackWindowPane
13331410function Wezterm .on (event , callback ) end
13341411
@@ -1338,13 +1415,25 @@ function Wezterm.on(event, callback) end
13381415--- - The first event parameter is a `Window` object that represents the GUI window
13391416--- - The second event parameter is a `Pane` object that represents the active pane in that window
13401417---
1341- --- @param event WindowFocusChanged
1418+ ---- --
1419+ --- The `"window-focus-changed"` event is emitted when the focus state
1420+ --- for a window is changed.
1421+ ---
1422+ --- @param event " window-focus-changed"
13421423--- @param callback CallbackWindowPane
13431424function Wezterm .on (event , callback ) end
13441425
13451426--- - The first event parameter is a `Window` object that represents the GUI window
13461427--- - The second event parameter is a `Pane` object that represents the active pane in that window
13471428---
1348- --- @param event WindowResized
1429+ --- The `"window-resized"` event is emitted when the window is resized
1430+ --- and when transitioning between full-screen and regular windowed mode.
1431+ ---
1432+ --- The event is triggered asynchronously with respect to the potentially-ongoing
1433+ --- live resize operation. `wezterm` will coalesce the stream of multiple events
1434+ --- generated by a live resize such that there can be
1435+ --- a maximum of 1 event executing and 1 event buffered.
1436+ ---
1437+ --- @param event " window-resized"
13491438--- @param callback CallbackWindowPane
13501439function Wezterm .on (event , callback ) end
0 commit comments