mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 13:21:38 +03:00
docs: fix lua syntax
This commit is contained in:
parent
98dd864df1
commit
7bd41772ab
@ -40,7 +40,7 @@ Sets additional environment variables in the environment for
|
||||
this command invocation.
|
||||
|
||||
```lua
|
||||
pane:split{set_environment_variables={"FOO"="BAR"}}
|
||||
pane:split{set_environment_variables={FOO="BAR"}}
|
||||
```
|
||||
|
||||
### domain
|
||||
|
@ -7,7 +7,7 @@ It is a lua object with the following fields; all of the fields
|
||||
have reasonable defaults and can be omitted.
|
||||
|
||||
```lua
|
||||
{
|
||||
wezterm.action.SpawnCommandInNewWindow{
|
||||
-- An optional label.
|
||||
-- The label is only used for SpawnCommands that are listed in
|
||||
-- the `launch_menu` configuration section.
|
||||
|
@ -6,6 +6,8 @@ The `SshDomain` struct specifies information about an individual
|
||||
It is a lua object with the following fields:
|
||||
|
||||
```lua
|
||||
return {
|
||||
ssh_domains = {
|
||||
{
|
||||
-- The name of this specific domain. Must be unique amongst
|
||||
-- all types of domain in the configuration file.
|
||||
@ -33,6 +35,8 @@ It is a lua object with the following fields:
|
||||
-- Primarily useful if it isn't installed in the $PATH
|
||||
-- that is configure for ssh.
|
||||
-- remote_wezterm_path = "/home/yourusername/bin/wezterm"
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -6,6 +6,8 @@ to a [TLS Domain](../../multiplexing.md#tls-domains).
|
||||
It is a lua object with the following fields:
|
||||
|
||||
```lua
|
||||
return {
|
||||
tls_domains = {
|
||||
{
|
||||
-- The name of this specific domain. Must be unique amongst
|
||||
-- all types of domain in the configuration file.
|
||||
@ -63,6 +65,8 @@ It is a lua object with the following fields:
|
||||
|
||||
-- The path to the wezterm binary on the remote host
|
||||
-- remote_wezterm_path = "/home/myname/bin/wezterm"
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -6,6 +6,8 @@ the server side of a [TLS Domain](../../multiplexing.md#tls-domains).
|
||||
It is a lua object with the following fields:
|
||||
|
||||
```lua
|
||||
return {
|
||||
tls_servers = {
|
||||
{
|
||||
-- The address:port combination on which the server will listen
|
||||
-- for client connections
|
||||
@ -30,5 +32,7 @@ It is a lua object with the following fields:
|
||||
-- to the trust store.
|
||||
-- You can omit this if your tls_client is using bootstrap_via_ssh.
|
||||
-- pem_root_certs = { "/some/path/ca1.pem", "/some/path/ca2.pem" },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -18,6 +18,8 @@ output from `wsl -l -v` and assigns that as the value of the
|
||||
A `WslDomain` is a lua object with the following fields:
|
||||
|
||||
```lua
|
||||
return {
|
||||
wls_domains = {
|
||||
{
|
||||
-- The name of this specific domain. Must be unique amonst all types
|
||||
-- of domain in the configuration file.
|
||||
@ -47,5 +49,7 @@ A `WslDomain` is a lua object with the following fields:
|
||||
-- specify it here
|
||||
|
||||
-- default_prog = {"fish"}
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
Computes the contrast ratio between the two colors.
|
||||
|
||||
```lua
|
||||
```
|
||||
> wezterm.color.parse("red"):contrast_ratio(wezterm.color.parse("yellow"))
|
||||
1
|
||||
> wezterm.color.parse("red"):contrast_ratio(wezterm.color.parse("navy"))
|
||||
@ -18,7 +18,7 @@ A contrast ratio of 1 means no contrast.
|
||||
|
||||
The maximum possible contrast ratio is 21:
|
||||
|
||||
```lua
|
||||
```
|
||||
> wezterm.color.parse("black"):contrast_ratio(wezterm.color.parse("white"))
|
||||
21
|
||||
```
|
||||
|
@ -5,7 +5,7 @@
|
||||
Returns a tuple of the colors converted to linear RGBA and
|
||||
expressed as floating point numbers in the range `0.0-1.0`:
|
||||
|
||||
```lua
|
||||
```
|
||||
> r, g, b, a = wezterm.color.parse("purple"):linear_rgba()
|
||||
> print(r, g, b, a)
|
||||
07:32:17.734 INFO logging > lua: 0.2158605307340622 0 0.2158605307340622 1
|
||||
|
@ -5,7 +5,7 @@
|
||||
Returns the other three colors that form a square. The other colors
|
||||
are 90 degrees apart on the HSL color wheel.
|
||||
|
||||
```lua
|
||||
```
|
||||
local a, b, c = wezterm:color.parse("yellow"):square()
|
||||
```
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
Returns a tuple of the internal SRGBA colors expressed
|
||||
as unsigned 8-bit integers in the range 0-255:
|
||||
|
||||
```lua
|
||||
```
|
||||
> r, g, b, a = wezterm.color.parse("purple"):srgba_u8()
|
||||
> print(r, g, b, a)
|
||||
07:30:20.045 INFO logging > lua: 128 0 128 255
|
||||
|
@ -6,7 +6,7 @@ Returns the other two colors that form a triad. The other colors
|
||||
are at +/- 120 degrees in the HSL color wheel.
|
||||
|
||||
```lua
|
||||
local a, b = wezterm:color.parse("yellow"):triad()
|
||||
local a, b = wezterm.color.parse("yellow"):triad()
|
||||
```
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@ then you can set:
|
||||
|
||||
```lua
|
||||
return {
|
||||
font_locator = "ConfigDirsOnly"`
|
||||
font_locator = "ConfigDirsOnly",
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -29,9 +29,11 @@ If your package manager installed the terminfo data in a non-standard location,
|
||||
The following snippet works if you installed `wezterm.terminfo` with nix into your user profile. Update the path to `TERMINFO_DIRS` to match the location on your system.
|
||||
|
||||
```lua
|
||||
return {
|
||||
set_environment_variables={
|
||||
TERMINFO_DIRS='/home/user/.nix-profile/share/terminfo',
|
||||
WSLENV='TERMINFO_DIRS'
|
||||
},
|
||||
term = "wezterm",
|
||||
}
|
||||
```
|
||||
|
@ -40,7 +40,7 @@ Sets additional environment variables in the environment for
|
||||
this command invocation.
|
||||
|
||||
```lua
|
||||
window:spawn_tab{set_environment_variables={"FOO"="BAR"}}
|
||||
window:spawn_tab{set_environment_variables={FOO="BAR"}}
|
||||
```
|
||||
|
||||
### domain
|
||||
|
@ -40,7 +40,7 @@ Sets additional environment variables in the environment for
|
||||
this command invocation.
|
||||
|
||||
```lua
|
||||
wezterm.mux.spawn_window{set_environment_variables={"FOO"="BAR"}}
|
||||
wezterm.mux.spawn_window{set_environment_variables={FOO="BAR"}}
|
||||
```
|
||||
|
||||
### domain
|
||||
|
@ -18,7 +18,7 @@ Indexing `wezterm.action` with a valid
|
||||
[KeyAssignment](../keyassignment/index.md) name will act as a constructor for
|
||||
that key assignment type. For example, the lua expression:
|
||||
|
||||
```lua
|
||||
```
|
||||
wezterm.action.QuickSelectArgs
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user