mirror of
https://github.com/wez/wezterm.git
synced 2024-12-25 14:22:37 +03:00
9d9f3c3c1a
This commit adds very basic first passes at representing the Pane
and GuiWindow types in lua script.
The `open-uri` event from 9397f2a2db
has been redefined to receive `(window, pane, uri)` parameters
instead of its prior very basic `uri` parameter.
A new key assignment `wezterm.action{EmitEvent="event-name"}` is
now available that allows a key binding assignment to emit an arbitrary
event, which in turn allows for triggering an arbitrary lua callback
in response to a key or mouse click.
`EmitEvent` passes the `(window, pane)` from the triggering window and
pane as parameters.
Here's a brief example:
```lua
local wezterm = require 'wezterm';
wezterm.on("my-thingy", function(window, pane)
local dims = pane:get_dimensions();
wezterm.log_error("did my thingy with window " .. window:window_id() ..
" pane " .. pane:pane_id() .. " " .. dims.cols .. "x" .. dims.viewport_rows);
window:perform_action("IncreaseFontSize", pane);
end)
return {
keys = {
{key="E", mods="CTRL", action=wezterm.action{EmitEvent="my-thingy"}},
}
}
```
refs: #223
refs: #225
28 lines
757 B
TOML
28 lines
757 B
TOML
[package]
|
|
name = "mux"
|
|
version = "0.1.0"
|
|
authors = ["Wez Furlong <wez@wezfurlong.org>"]
|
|
edition = "2018"
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[dependencies]
|
|
anyhow = "1.0"
|
|
async-trait = "0.1"
|
|
bintree = { path = "../bintree" }
|
|
config = { path = "../config" }
|
|
downcast-rs = "1.0"
|
|
libc = "0.2"
|
|
log = "0.4"
|
|
luahelper = { path = "../luahelper" }
|
|
portable-pty = { path = "../pty", features = ["serde_support"]}
|
|
promise = { path = "../promise" }
|
|
rangeset = { path = "../rangeset" }
|
|
ratelim= { path = "../ratelim" }
|
|
regex = "1"
|
|
serde = {version="1.0", features = ["rc", "derive"]}
|
|
termwiz = { path = "../termwiz" }
|
|
thiserror = "1.0"
|
|
url = "2"
|
|
wezterm-term = { path = "../term", features=["use_serde"] }
|