1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-26 16:34:23 +03:00

docs: add docs for the window object

refs: #225
This commit is contained in:
Wez Furlong 2020-10-09 23:34:35 -07:00
parent 850fdf40de
commit b009e8c0d4
5 changed files with 39 additions and 0 deletions

1
.gitignore vendored
View File

@ -13,6 +13,7 @@
/docs/install/*.md
/docs/config/lua/wezterm/index.md
/docs/config/lua/pane/index.md
/docs/config/lua/window/index.md
**/*.rs.bk
.*.sw*
/esctest.log

View File

@ -78,6 +78,7 @@ TOC = [
children=[
Gen("module: wezterm", "config/lua/wezterm"),
Gen("object: Pane", "config/lua/pane"),
Gen("object: Window", "config/lua/window"),
],
),
Page("Scrollback", "scrollback.markdown"),

View File

@ -54,6 +54,14 @@ wezterm.on("open-uri", function(window, pane, uri)
end)
```
The first event parameter is a [`window` object](../window/index.md) that
represents the gui window.
The second event parameter is a [`pane` object](../pane/index.md) that
represents the pane.
The third event parameter is the URI string.
## Custom Events
You may register handlers for arbitrary events for which wezterm itself
@ -108,3 +116,8 @@ return {
}
```
The first event parameter is a [`window` object](../window/index.md) that
represents the gui window.
The second event parameter is a [`pane` object](../pane/index.md) that
represents the pane.

View File

@ -0,0 +1,16 @@
# `window:perform_action(key_assignment, pane)`
*Since: nightly builds only*
Performs a key assignment against the `window` and `pane`.
There are a number of actions that can be performed against a `pane` in
a `window` when configured via the `keys` and `mouse` configuration options.
This method allows your lua script to trigger those actions for itself.
The first parameter is a key assignment such as that returned by [`wezterm.action`](../wezterm/action.md).
The second parameter is a `pane` object passed to your event callback.
For an example of this method in action, see [`wezterm.on Custom Events`](../wezterm/on.md#custom-events).

View File

@ -0,0 +1,8 @@
# `window:window_id()`
*Since: nightly builds only*
Returns the id number for the window. The Id is used to identify the window
within the internal multiplexer and can be used when making API calls
via `wezterm cli` to indicate the subject of manipulation.