mirror of
https://github.com/wez/wezterm.git
synced 2024-09-11 22:37:11 +03:00
docs: apply stylua formatting
refs: https://github.com/wez/wezterm/pull/2273 refs: https://github.com/wez/wezterm/issues/2253
This commit is contained in:
parent
7bd41772ab
commit
e0ea0f46a8
@ -6,7 +6,7 @@ You can select a color scheme with a line like this:
|
||||
|
||||
```lua
|
||||
return {
|
||||
color_scheme = "Batman",
|
||||
color_scheme = 'Batman',
|
||||
}
|
||||
```
|
||||
|
||||
@ -29,44 +29,62 @@ usual hex notation; eg: `#000000` is equivalent to `black`:
|
||||
```lua
|
||||
return {
|
||||
colors = {
|
||||
-- The default text color
|
||||
foreground = "silver",
|
||||
-- The default background color
|
||||
background = "black",
|
||||
-- The default text color
|
||||
foreground = 'silver',
|
||||
-- The default background color
|
||||
background = 'black',
|
||||
|
||||
-- Overrides the cell background color when the current cell is occupied by the
|
||||
-- cursor and the cursor style is set to Block
|
||||
cursor_bg = "#52ad70",
|
||||
-- Overrides the text color when the current cell is occupied by the cursor
|
||||
cursor_fg = "black",
|
||||
-- Specifies the border color of the cursor when the cursor style is set to Block,
|
||||
-- or the color of the vertical or horizontal bar when the cursor style is set to
|
||||
-- Bar or Underline.
|
||||
cursor_border = "#52ad70",
|
||||
-- Overrides the cell background color when the current cell is occupied by the
|
||||
-- cursor and the cursor style is set to Block
|
||||
cursor_bg = '#52ad70',
|
||||
-- Overrides the text color when the current cell is occupied by the cursor
|
||||
cursor_fg = 'black',
|
||||
-- Specifies the border color of the cursor when the cursor style is set to Block,
|
||||
-- or the color of the vertical or horizontal bar when the cursor style is set to
|
||||
-- Bar or Underline.
|
||||
cursor_border = '#52ad70',
|
||||
|
||||
-- the foreground color of selected text
|
||||
selection_fg = "black",
|
||||
-- the background color of selected text
|
||||
selection_bg = "#fffacd",
|
||||
-- the foreground color of selected text
|
||||
selection_fg = 'black',
|
||||
-- the background color of selected text
|
||||
selection_bg = '#fffacd',
|
||||
|
||||
-- The color of the scrollbar "thumb"; the portion that represents the current viewport
|
||||
scrollbar_thumb = "#222222",
|
||||
-- The color of the scrollbar "thumb"; the portion that represents the current viewport
|
||||
scrollbar_thumb = '#222222',
|
||||
|
||||
-- The color of the split lines between panes
|
||||
split = "#444444",
|
||||
-- The color of the split lines between panes
|
||||
split = '#444444',
|
||||
|
||||
ansi = {"black", "maroon", "green", "olive", "navy", "purple", "teal", "silver"},
|
||||
brights = {"grey", "red", "lime", "yellow", "blue", "fuchsia", "aqua", "white"},
|
||||
ansi = {
|
||||
'black',
|
||||
'maroon',
|
||||
'green',
|
||||
'olive',
|
||||
'navy',
|
||||
'purple',
|
||||
'teal',
|
||||
'silver',
|
||||
},
|
||||
brights = {
|
||||
'grey',
|
||||
'red',
|
||||
'lime',
|
||||
'yellow',
|
||||
'blue',
|
||||
'fuchsia',
|
||||
'aqua',
|
||||
'white',
|
||||
},
|
||||
|
||||
-- Arbitrary colors of the palette in the range from 16 to 255
|
||||
indexed = {[136] = "#af8700"},
|
||||
-- Arbitrary colors of the palette in the range from 16 to 255
|
||||
indexed = { [136] = '#af8700' },
|
||||
|
||||
-- Since: 20220319-142410-0fcdea07
|
||||
-- When the IME, a dead key or a leader key are being processed and are effectively
|
||||
-- holding input pending the result of input composition, change the cursor
|
||||
-- to this color to give a visual cue about the compose state.
|
||||
compose_cursor = "orange",
|
||||
}
|
||||
-- Since: 20220319-142410-0fcdea07
|
||||
-- When the IME, a dead key or a leader key are being processed and are effectively
|
||||
-- holding input pending the result of input composition, change the cursor
|
||||
-- to this color to give a visual cue about the compose state.
|
||||
compose_cursor = 'orange',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -77,14 +95,14 @@ You may specify colors in the HSL color space, if you prefer that over RGB, by u
|
||||
```lua
|
||||
return {
|
||||
colors = {
|
||||
-- the first number is the hue measured in degrees with a range
|
||||
-- of 0-360.
|
||||
-- The second number is the saturation measured in percentage with
|
||||
-- a range of 0-100.
|
||||
-- The third number is the lightness measured in percentage with
|
||||
-- a range of 0-100.
|
||||
foreground = "hsl:235 100 50",
|
||||
}
|
||||
-- the first number is the hue measured in degrees with a range
|
||||
-- of 0-360.
|
||||
-- The second number is the saturation measured in percentage with
|
||||
-- a range of 0-100.
|
||||
-- The third number is the lightness measured in percentage with
|
||||
-- a range of 0-100.
|
||||
foreground = 'hsl:235 100 50',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -119,12 +137,12 @@ return {
|
||||
colors = {
|
||||
-- Make the selection text color fully transparent.
|
||||
-- When fully transparent, the current text color will be used.
|
||||
selection_fg = "none",
|
||||
selection_fg = 'none',
|
||||
-- Set the selection background color with alpha.
|
||||
-- When selection_bg is transparent, it will be alpha blended over
|
||||
-- the current cell background color, rather than replace it
|
||||
selection_bg = "rgba(50% 50% 50% 50%)"
|
||||
}
|
||||
selection_bg = 'rgba(50% 50% 50% 50%)',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -143,15 +161,15 @@ to use in the `color_schemes` sections.
|
||||
|
||||
```lua
|
||||
return {
|
||||
color_scheme = "Red Scheme",
|
||||
color_scheme = 'Red Scheme',
|
||||
|
||||
color_schemes = {
|
||||
["Red Scheme"] = {
|
||||
background = "red",
|
||||
['Red Scheme'] = {
|
||||
background = 'red',
|
||||
},
|
||||
['Blue Scheme'] = {
|
||||
background = 'blue',
|
||||
},
|
||||
["Blue Scheme"] = {
|
||||
background = "blue",
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
@ -178,7 +196,7 @@ will need to instruct wezterm where to look for your scheme files; the
|
||||
|
||||
```lua
|
||||
return {
|
||||
color_scheme_dirs = {"/some/path/to/my/color/schemes"},
|
||||
color_scheme_dirs = { '/some/path/to/my/color/schemes' },
|
||||
}
|
||||
```
|
||||
|
||||
@ -236,7 +254,7 @@ return {
|
||||
-- Whatever font is selected here, it will have the
|
||||
-- main font setting appended to it to pick up any
|
||||
-- fallback fonts you may have used there.
|
||||
font = wezterm.font({family="Roboto", weight="Bold"}),
|
||||
font = wezterm.font { family = 'Roboto', weight = 'Bold' },
|
||||
|
||||
-- The size of the font in the tab bar.
|
||||
-- Default to 10. on Windows but 12.0 on other systems
|
||||
@ -244,17 +262,17 @@ return {
|
||||
|
||||
-- The overall background color of the tab bar when
|
||||
-- the window is focused
|
||||
active_titlebar_bg = "#333333",
|
||||
active_titlebar_bg = '#333333',
|
||||
|
||||
-- The overall background color of the tab bar when
|
||||
-- the window is not focused
|
||||
inactive_titlebar_bg = "#333333",
|
||||
inactive_titlebar_bg = '#333333',
|
||||
},
|
||||
|
||||
colors = {
|
||||
tab_bar = {
|
||||
-- The color of the inactive tab bar edge/divider
|
||||
inactive_tab_edge = "#575757",
|
||||
inactive_tab_edge = '#575757',
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -273,24 +291,24 @@ return {
|
||||
tab_bar = {
|
||||
-- The color of the strip that goes along the top of the window
|
||||
-- (does not apply when fancy tab bar is in use)
|
||||
background = "#0b0022",
|
||||
background = '#0b0022',
|
||||
|
||||
-- The active tab is the one that has focus in the window
|
||||
active_tab = {
|
||||
-- The color of the background area for the tab
|
||||
bg_color = "#2b2042",
|
||||
bg_color = '#2b2042',
|
||||
-- The color of the text for the tab
|
||||
fg_color = "#c0c0c0",
|
||||
fg_color = '#c0c0c0',
|
||||
|
||||
-- Specify whether you want "Half", "Normal" or "Bold" intensity for the
|
||||
-- label shown for this tab.
|
||||
-- The default is "Normal"
|
||||
intensity = "Normal",
|
||||
intensity = 'Normal',
|
||||
|
||||
-- Specify whether you want "None", "Single" or "Double" underline for
|
||||
-- label shown for this tab.
|
||||
-- The default is "None"
|
||||
underline = "None",
|
||||
underline = 'None',
|
||||
|
||||
-- Specify whether you want the text to be italic (true) or not (false)
|
||||
-- for this tab. The default is false.
|
||||
@ -303,8 +321,8 @@ return {
|
||||
|
||||
-- Inactive tabs are the tabs that do not have focus
|
||||
inactive_tab = {
|
||||
bg_color = "#1b1032",
|
||||
fg_color = "#808080",
|
||||
bg_color = '#1b1032',
|
||||
fg_color = '#808080',
|
||||
|
||||
-- The same options that were listed under the `active_tab` section above
|
||||
-- can also be used for `inactive_tab`.
|
||||
@ -313,8 +331,8 @@ return {
|
||||
-- You can configure some alternate styling when the mouse pointer
|
||||
-- moves over inactive tabs
|
||||
inactive_tab_hover = {
|
||||
bg_color = "#3b3052",
|
||||
fg_color = "#909090",
|
||||
bg_color = '#3b3052',
|
||||
fg_color = '#909090',
|
||||
italic = true,
|
||||
|
||||
-- The same options that were listed under the `active_tab` section above
|
||||
@ -323,8 +341,8 @@ return {
|
||||
|
||||
-- The new tab button that let you create new tabs
|
||||
new_tab = {
|
||||
bg_color = "#1b1032",
|
||||
fg_color = "#808080",
|
||||
bg_color = '#1b1032',
|
||||
fg_color = '#808080',
|
||||
|
||||
-- The same options that were listed under the `active_tab` section above
|
||||
-- can also be used for `new_tab`.
|
||||
@ -333,15 +351,15 @@ return {
|
||||
-- You can configure some alternate styling when the mouse pointer
|
||||
-- moves over the new tab button
|
||||
new_tab_hover = {
|
||||
bg_color = "#3b3052",
|
||||
fg_color = "#909090",
|
||||
bg_color = '#3b3052',
|
||||
fg_color = '#909090',
|
||||
italic = true,
|
||||
|
||||
-- The same options that were listed under the `active_tab` section above
|
||||
-- can also be used for `new_tab_hover`.
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -369,7 +387,7 @@ return {
|
||||
inactive_pane_hsb = {
|
||||
saturation = 0.9,
|
||||
brightness = 0.8,
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -400,7 +418,7 @@ You can attach an image to the background of the wezterm window:
|
||||
|
||||
```lua
|
||||
return {
|
||||
window_background_image = "/path/to/wallpaper.jpg"
|
||||
window_background_image = '/path/to/wallpaper.jpg',
|
||||
}
|
||||
```
|
||||
|
||||
@ -419,9 +437,8 @@ You can optionally transform the background image by specifying
|
||||
a hue, saturation, brightness multiplier:
|
||||
|
||||
```lua
|
||||
|
||||
return {
|
||||
window_background_image = "/path/to/wallpaper.jpg",
|
||||
window_background_image = '/path/to/wallpaper.jpg',
|
||||
|
||||
window_background_image_hsb = {
|
||||
-- Darken the background image by reducing it to 1/3rd
|
||||
|
@ -78,8 +78,7 @@ degree of flexibility. The script is expected to return a configuration
|
||||
table, so a basic empty configuration file will look like this:
|
||||
|
||||
```lua
|
||||
return {
|
||||
}
|
||||
return {}
|
||||
```
|
||||
|
||||
Throughout these docs you'll find configuration fragments that demonstrate
|
||||
@ -87,16 +86,16 @@ configuration and that look something like this:
|
||||
|
||||
```lua
|
||||
return {
|
||||
color_scheme = "Batman",
|
||||
color_scheme = 'Batman',
|
||||
}
|
||||
```
|
||||
|
||||
and perhaps another one like this:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
return {
|
||||
font = wezterm.font("JetBrains Mono"),
|
||||
font = wezterm.font 'JetBrains Mono',
|
||||
}
|
||||
```
|
||||
|
||||
@ -104,10 +103,10 @@ If you wanted to use both of these in the same file, you would merge them togeth
|
||||
like this:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
return {
|
||||
font = wezterm.font("JetBrains Mono"),
|
||||
color_scheme = "Batman",
|
||||
font = wezterm.font 'JetBrains Mono',
|
||||
color_scheme = 'Batman',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -21,7 +21,7 @@ use a setting like this:
|
||||
|
||||
```lua
|
||||
return {
|
||||
harfbuzz_features = {"calt=0", "clig=0", "liga=0"},
|
||||
harfbuzz_features = { 'calt=0', 'clig=0', 'liga=0' },
|
||||
}
|
||||
```
|
||||
|
||||
@ -36,7 +36,7 @@ and you can set them in wezterm:
|
||||
return {
|
||||
-- Use this for a zero with a dot rather than a line through it
|
||||
-- when using the Fira Code font
|
||||
harfbuzz_features = {"zero"}
|
||||
harfbuzz_features = { 'zero' },
|
||||
}
|
||||
```
|
||||
|
||||
@ -48,10 +48,10 @@ globally for all fonts:
|
||||
```lua
|
||||
local wezterm = require 'wezterm'
|
||||
return {
|
||||
font = wezterm.font({
|
||||
family="JetBrains Mono",
|
||||
harfbuzz_features={"calt=0", "clig=0", "liga=0"}
|
||||
})
|
||||
font = wezterm.font {
|
||||
family = 'JetBrains Mono',
|
||||
harfbuzz_features = { 'calt=0', 'clig=0', 'liga=0' },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -59,18 +59,18 @@ and this example disables ligatures for JetBrains Mono,
|
||||
but keeps the default for the other fonts in the fallback:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
font = wezterm.font_with_fallback({
|
||||
font = wezterm.font_with_fallback {
|
||||
{
|
||||
family="JetBrains Mono",
|
||||
weight="Medium",
|
||||
harfbuzz_features={"calt=0", "clig=0", "liga=0"}
|
||||
family = 'JetBrains Mono',
|
||||
weight = 'Medium',
|
||||
harfbuzz_features = { 'calt=0', 'clig=0', 'liga=0' },
|
||||
},
|
||||
{family="Terminus", weight="Bold"},
|
||||
"Noto Color Emoji"
|
||||
}),
|
||||
{ family = 'Terminus', weight = 'Bold' },
|
||||
'Noto Color Emoji',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -9,13 +9,13 @@ If you wish to use a different font face, then you can use
|
||||
the [wezterm.font](lua/wezterm/font.md) function to specify it:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
font = wezterm.font("Fira Code"),
|
||||
font = wezterm.font 'Fira Code',
|
||||
-- You can specify some parameters to influence the font selection;
|
||||
-- for example, this selects a Bold, Italic font variant.
|
||||
font = wezterm.font("JetBrains Mono", {weight="Bold", italic=true})
|
||||
font = wezterm.font('JetBrains Mono', { weight = 'Bold', italic = true }),
|
||||
}
|
||||
```
|
||||
|
||||
@ -36,12 +36,12 @@ monospace font, but it doesn't have glyphs for the asian script that you
|
||||
sometimes work with:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
return {
|
||||
font = wezterm.font_with_fallback({
|
||||
"Fira Code",
|
||||
"DengXian",
|
||||
}),
|
||||
font = wezterm.font_with_fallback {
|
||||
'Fira Code',
|
||||
'DengXian',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -22,31 +22,39 @@ local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
-- Show which key table is active in the status area
|
||||
wezterm.on("update-right-status", function(window, pane)
|
||||
wezterm.on('update-right-status', function(window, pane)
|
||||
local name = window:active_key_table()
|
||||
if name then
|
||||
name = "TABLE: " .. name
|
||||
name = 'TABLE: ' .. name
|
||||
end
|
||||
window:set_right_status(name or "")
|
||||
window:set_right_status(name or '')
|
||||
end)
|
||||
|
||||
return {
|
||||
leader = {key="Space", mods="CTRL|SHIFT"},
|
||||
leader = { key = 'Space', mods = 'CTRL|SHIFT' },
|
||||
keys = {
|
||||
-- CTRL+SHIFT+Space, followed by 'r' will put us in resize-pane
|
||||
-- mode until we cancel that mode.
|
||||
{key="r", mods="LEADER", action=act.ActivateKeyTable{
|
||||
name="resize_pane",
|
||||
one_shot=false,
|
||||
}},
|
||||
{
|
||||
key = 'r',
|
||||
mods = 'LEADER',
|
||||
action = act.ActivateKeyTable {
|
||||
name = 'resize_pane',
|
||||
one_shot = false,
|
||||
},
|
||||
},
|
||||
|
||||
-- CTRL+SHIFT+Space, followed by 'a' will put us in activate-pane
|
||||
-- mode until we press some other key or until 1 second (1000ms)
|
||||
-- of time elapses
|
||||
{key="a", mods="LEADER", action=act.ActivateKeyTable{
|
||||
name="activate_pane",
|
||||
timeout_milliseconds=1000,
|
||||
}},
|
||||
{
|
||||
key = 'a',
|
||||
mods = 'LEADER',
|
||||
action = act.ActivateKeyTable {
|
||||
name = 'activate_pane',
|
||||
timeout_milliseconds = 1000,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
key_tables = {
|
||||
@ -57,43 +65,40 @@ return {
|
||||
-- 'resize_pane' here corresponds to the name="resize_pane" in
|
||||
-- the key assignments above.
|
||||
resize_pane = {
|
||||
{key="LeftArrow", action=act.AdjustPaneSize{"Left", 1}},
|
||||
{key="h", action=act.AdjustPaneSize{"Left", 1}},
|
||||
{ key = 'LeftArrow', action = act.AdjustPaneSize { 'Left', 1 } },
|
||||
{ key = 'h', action = act.AdjustPaneSize { 'Left', 1 } },
|
||||
|
||||
{key="RightArrow", action=act.AdjustPaneSize{"Right", 1}},
|
||||
{key="l", action=act.AdjustPaneSize{"Right", 1}},
|
||||
{ key = 'RightArrow', action = act.AdjustPaneSize { 'Right', 1 } },
|
||||
{ key = 'l', action = act.AdjustPaneSize { 'Right', 1 } },
|
||||
|
||||
{key="UpArrow", action=act.AdjustPaneSize{"Up", 1}},
|
||||
{key="k", action=act.AdjustPaneSize{"Up", 1}},
|
||||
{ key = 'UpArrow', action = act.AdjustPaneSize { 'Up', 1 } },
|
||||
{ key = 'k', action = act.AdjustPaneSize { 'Up', 1 } },
|
||||
|
||||
{key="DownArrow", action=act.AdjustPaneSize{"Down", 1}},
|
||||
{key="j", action=act.AdjustPaneSize{"Down", 1}},
|
||||
{ key = 'DownArrow', action = act.AdjustPaneSize { 'Down', 1 } },
|
||||
{ key = 'j', action = act.AdjustPaneSize { 'Down', 1 } },
|
||||
|
||||
-- Cancel the mode by pressing escape
|
||||
{key="Escape", action="PopKeyTable"},
|
||||
|
||||
{ key = 'Escape', action = 'PopKeyTable' },
|
||||
},
|
||||
|
||||
-- Defines the keys that are active in our activate-pane mode.
|
||||
-- 'activate_pane' here corresponds to the name="activate_pane" in
|
||||
-- the key assignments above.
|
||||
activate_pane = {
|
||||
{key="LeftArrow", action=act.ActivatePaneDirection("Left")},
|
||||
{key="h", action=act.ActivatePaneDirection("Left")},
|
||||
{ key = 'LeftArrow', action = act.ActivatePaneDirection 'Left' },
|
||||
{ key = 'h', action = act.ActivatePaneDirection 'Left' },
|
||||
|
||||
{key="RightArrow", action=act.ActivatePaneDirection("Right")},
|
||||
{key="l", action=act.ActivatePaneDirection("Right")},
|
||||
{ key = 'RightArrow', action = act.ActivatePaneDirection 'Right' },
|
||||
{ key = 'l', action = act.ActivatePaneDirection 'Right' },
|
||||
|
||||
{key="UpArrow", action=act.ActivatePaneDirection("Up")},
|
||||
{key="k", action=act.ActivatePaneDirection("Up")},
|
||||
{ key = 'UpArrow', action = act.ActivatePaneDirection 'Up' },
|
||||
{ key = 'k', action = act.ActivatePaneDirection 'Up' },
|
||||
|
||||
{key="DownArrow", action=act.ActivatePaneDirection("Down")},
|
||||
{key="j", action=act.ActivatePaneDirection("Down")},
|
||||
{ key = 'DownArrow', action = act.ActivatePaneDirection 'Down' },
|
||||
{ key = 'j', action = act.ActivatePaneDirection 'Down' },
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Key Table Activation Stack
|
||||
|
@ -108,8 +108,8 @@ You can control this behavior in your configuration:
|
||||
|
||||
```lua
|
||||
return {
|
||||
send_composed_key_when_left_alt_is_pressed=false,
|
||||
send_composed_key_when_right_alt_is_pressed=true,
|
||||
send_composed_key_when_left_alt_is_pressed = false,
|
||||
send_composed_key_when_right_alt_is_pressed = true,
|
||||
}
|
||||
```
|
||||
|
||||
@ -152,7 +152,7 @@ file:
|
||||
|
||||
```lua
|
||||
return {
|
||||
use_dead_keys = false
|
||||
use_dead_keys = false,
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -5,14 +5,14 @@ The default key table assignments can be overridden or extended using the
|
||||
disable a default assignment like this:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
-- Turn off the default CMD-m Hide action, allowing CMD-m to
|
||||
-- be potentially recognized and handled by the tab
|
||||
{key="m", mods="CMD", action="DisableDefaultAssignment"}
|
||||
}
|
||||
{ key = 'm', mods = 'CMD', action = 'DisableDefaultAssignment' },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -137,16 +137,24 @@ milliseconds). While `LEADER` is active, the `|` key (with no other modifiers)
|
||||
will trigger the current pane to be split.
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
-- timeout_milliseconds defaults to 1000 and can be omitted
|
||||
leader = { key="a", mods="CTRL", timeout_milliseconds=1000 },
|
||||
leader = { key = 'a', mods = 'CTRL', timeout_milliseconds = 1000 },
|
||||
keys = {
|
||||
{key="|", mods="LEADER|SHIFT", action=wezterm.action.SplitHorizontal{domain="CurrentPaneDomain"}},
|
||||
{
|
||||
key = '|',
|
||||
mods = 'LEADER|SHIFT',
|
||||
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
|
||||
},
|
||||
-- Send "CTRL-A" to the terminal when pressing CTRL-A, CTRL-A
|
||||
{key="a", mods="LEADER|CTRL", action=wezterm.action.SendString("\x01")},
|
||||
}
|
||||
{
|
||||
key = 'a',
|
||||
mods = 'LEADER|CTRL',
|
||||
action = wezterm.action.SendString '\x01',
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -161,16 +169,24 @@ uses `CapsLock` as a `LEADER` without it affecting the shift / capital state as
|
||||
long as you have `setxkbmap -option caps:none` configured.
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
-- timeout_milliseconds defaults to 1000 and can be omitted
|
||||
-- for this example use `setxkbmap -option caps:none` in your terminal.
|
||||
leader = { key="VoidSymbol", mods="", timeout_milliseconds=1000 },
|
||||
leader = { key = 'VoidSymbol', mods = '', timeout_milliseconds = 1000 },
|
||||
keys = {
|
||||
{key="|", mods="LEADER|SHIFT", action=wezterm.action.SplitHorizontal{domain="CurrentPaneDomain"}},
|
||||
{key="-", mods="LEADER", action=wezterm.action.SplitVertical{domain="CurrentPaneDomain"}},
|
||||
}
|
||||
{
|
||||
key = '|',
|
||||
mods = 'LEADER|SHIFT',
|
||||
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
|
||||
},
|
||||
{
|
||||
key = '-',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -37,7 +37,7 @@ portably:
|
||||
```lua
|
||||
return {
|
||||
-- Spawn a fish shell in login mode
|
||||
default_prog = {"/usr/local/bin/fish", "-l"},
|
||||
default_prog = { '/usr/local/bin/fish', '-l' },
|
||||
}
|
||||
```
|
||||
|
||||
@ -110,7 +110,7 @@ return {
|
||||
-- This changes the default prompt for cmd.exe to report the
|
||||
-- current directory using OSC 7, show the current time and
|
||||
-- the current directory colored in the prompt.
|
||||
prompt = "$E]7;file://localhost/$P$E\\$E[32m$T$E[0m $E[35m$P$E[36m$_$G$E[0m "
|
||||
prompt = '$E]7;file://localhost/$P$E\\$E[32m$T$E[0m $E[35m$P$E[36m$_$G$E[0m ',
|
||||
},
|
||||
}
|
||||
```
|
||||
@ -140,15 +140,15 @@ Each entry in `launch_menu` is an instance of a
|
||||
return {
|
||||
launch_menu = {
|
||||
{
|
||||
args = {"top"},
|
||||
args = { 'top' },
|
||||
},
|
||||
{
|
||||
-- Optional label to show in the launcher. If omitted, a label
|
||||
-- is derived from the `args`
|
||||
label = "Bash",
|
||||
label = 'Bash',
|
||||
-- The argument array to spawn. If omitted the default program
|
||||
-- will be used as described in the documentation above
|
||||
args = {"bash", "-l"},
|
||||
args = { 'bash', '-l' },
|
||||
|
||||
-- You can specify an alternative current working directory;
|
||||
-- if you don't specify one then a default based on the OSC 7
|
||||
@ -161,7 +161,7 @@ return {
|
||||
-- set_environment_variables configuration option described above
|
||||
-- set_environment_variables = { FOO = "bar" },
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -175,28 +175,39 @@ entries by default, unless disabled using `add_wsl_distributions_to_launch_menu
|
||||
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
local launch_menu = {}
|
||||
|
||||
if wezterm.target_triple == "x86_64-pc-windows-msvc" then
|
||||
if wezterm.target_triple == 'x86_64-pc-windows-msvc' then
|
||||
table.insert(launch_menu, {
|
||||
label = "PowerShell",
|
||||
args = {"powershell.exe", "-NoLogo"},
|
||||
label = 'PowerShell',
|
||||
args = { 'powershell.exe', '-NoLogo' },
|
||||
})
|
||||
|
||||
-- Find installed visual studio version(s) and add their compilation
|
||||
-- environment command prompts to the menu
|
||||
for _, vsvers in ipairs(wezterm.glob("Microsoft Visual Studio/20*", "C:/Program Files (x86)")) do
|
||||
local year = vsvers:gsub("Microsoft Visual Studio/", "")
|
||||
for _, vsvers in
|
||||
ipairs(
|
||||
wezterm.glob('Microsoft Visual Studio/20*', 'C:/Program Files (x86)')
|
||||
)
|
||||
do
|
||||
local year = vsvers:gsub('Microsoft Visual Studio/', '')
|
||||
table.insert(launch_menu, {
|
||||
label = "x64 Native Tools VS " .. year,
|
||||
args = {"cmd.exe", "/k", "C:/Program Files (x86)/" .. vsvers .. "/BuildTools/VC/Auxiliary/Build/vcvars64.bat"},
|
||||
label = 'x64 Native Tools VS ' .. year,
|
||||
args = {
|
||||
'cmd.exe',
|
||||
'/k',
|
||||
'C:/Program Files (x86)/'
|
||||
.. vsvers
|
||||
.. '/BuildTools/VC/Auxiliary/Build/vcvars64.bat',
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
-- Enumerate any WSL distributions that are installed and add those to the menu
|
||||
local success, wsl_list, wsl_err = wezterm.run_child_process({"wsl.exe", "-l"})
|
||||
local success, wsl_list, wsl_err =
|
||||
wezterm.run_child_process { 'wsl.exe', '-l' }
|
||||
-- `wsl.exe -l` has a bug where it always outputs utf16:
|
||||
-- https://github.com/microsoft/WSL/issues/4607
|
||||
-- So we get to convert it
|
||||
@ -207,20 +218,27 @@ if wezterm.target_triple == "x86_64-pc-windows-msvc" then
|
||||
if idx > 1 then
|
||||
-- Remove the "(Default)" marker from the default line to arrive
|
||||
-- at the distribution name on its own
|
||||
local distro = line:gsub(" %(Default%)", "")
|
||||
local distro = line:gsub(' %(Default%)', '')
|
||||
|
||||
-- Add an entry that will spawn into the distro with the default shell
|
||||
table.insert(launch_menu, {
|
||||
label = distro .. " (WSL default shell)",
|
||||
args = {"wsl.exe", "--distribution", distro},
|
||||
label = distro .. ' (WSL default shell)',
|
||||
args = { 'wsl.exe', '--distribution', distro },
|
||||
})
|
||||
|
||||
-- Here's how to jump directly into some other program; in this example
|
||||
-- its a shell that probably isn't the default, but it could also be
|
||||
-- any other program that you want to run in that environment
|
||||
table.insert(launch_menu, {
|
||||
label = distro .. " (WSL zsh login shell)",
|
||||
args = {"wsl.exe", "--distribution", distro, "--exec", "/bin/zsh", "-l"},
|
||||
label = distro .. ' (WSL zsh login shell)',
|
||||
args = {
|
||||
'wsl.exe',
|
||||
'--distribution',
|
||||
distro,
|
||||
'--exec',
|
||||
'/bin/zsh',
|
||||
'-l',
|
||||
},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
@ -34,7 +34,7 @@ wezterm.exec_domain(NAME, FIXUP [, LABEL])
|
||||
The simplest fixup function looks like this:
|
||||
|
||||
```lua
|
||||
wezterm.exec_domain("myname", function (cmd)
|
||||
wezterm.exec_domain('myname', function(cmd)
|
||||
return cmd
|
||||
end)
|
||||
```
|
||||
@ -58,7 +58,7 @@ behavior is equivalent to this callback function definition:
|
||||
```lua
|
||||
-- domain_name is the same name you used as the first parameter to
|
||||
-- wezterm.exec_domain()
|
||||
wezterm.exec_domains(domain_name, fixup_func, function (domain_name)
|
||||
wezterm.exec_domains(domain_name, fixup_func, function(domain_name)
|
||||
return domain_name
|
||||
end)
|
||||
```
|
||||
@ -83,7 +83,7 @@ local wezterm = require 'wezterm'
|
||||
-- Given "/foo/bar" returns "bar"
|
||||
-- Given "c:\\foo\\bar" returns "bar"
|
||||
local function basename(s)
|
||||
return string.gsub(s, "(.*[/\\])(.*)", "%2")
|
||||
return string.gsub(s, '(.*[/\\])(.*)', '%2')
|
||||
end
|
||||
|
||||
return {
|
||||
@ -93,7 +93,7 @@ return {
|
||||
-- This defines a strong boundary for resource control and can
|
||||
-- help to avoid OOMs in one pane causing other panes to be
|
||||
-- killed.
|
||||
wezterm.exec_domain("scoped", function(cmd)
|
||||
wezterm.exec_domain('scoped', function(cmd)
|
||||
-- The "cmd" parameter is a SpawnCommand object.
|
||||
-- You can log it to see what's inside:
|
||||
wezterm.log_info(cmd)
|
||||
@ -104,7 +104,10 @@ return {
|
||||
-- WEZTERM_UNIX_SOCKET is associated with the wezterm
|
||||
-- process id.
|
||||
local env = cmd.set_environment_variables
|
||||
local ident = "wezterm-pane-" .. env.WEZTERM_PANE .. "-on-" .. basename(env.WEZTERM_UNIX_SOCKET)
|
||||
local ident = 'wezterm-pane-'
|
||||
.. env.WEZTERM_PANE
|
||||
.. '-on-'
|
||||
.. basename(env.WEZTERM_UNIX_SOCKET)
|
||||
|
||||
-- Generate a new argument array that will launch a
|
||||
-- program via systemd-run
|
||||
@ -122,7 +125,7 @@ return {
|
||||
-- Note that cmd.args may be nil; that indicates that the
|
||||
-- default program should be used. Here we're using the
|
||||
-- shell defined by the SHELL environment variable.
|
||||
for _, arg in ipairs(cmd.args or {os.getenv("SHELL")}) do
|
||||
for _, arg in ipairs(cmd.args or { os.getenv 'SHELL' }) do
|
||||
table.insert(wrapped, arg)
|
||||
end
|
||||
|
||||
@ -136,7 +139,7 @@ return {
|
||||
|
||||
-- Making the domain the default means that every pane/tab/window
|
||||
-- spawned by wezterm will have its own scope
|
||||
default_domain = "scoped",
|
||||
default_domain = 'scoped',
|
||||
}
|
||||
```
|
||||
|
||||
@ -156,11 +159,11 @@ end
|
||||
|
||||
function make_docker_fixup_func(id)
|
||||
return function(cmd)
|
||||
cmd.args = cmd.args or {"/bin/bash"}
|
||||
cmd.args = cmd.args or { '/bin/bash' }
|
||||
local wrapped = {
|
||||
"docker",
|
||||
"exec",
|
||||
"-it",
|
||||
'docker',
|
||||
'exec',
|
||||
'-it',
|
||||
id,
|
||||
}
|
||||
for _, arg in ipairs(cmd.args) do
|
||||
@ -178,17 +181,19 @@ function make_docker_label_func(id)
|
||||
-- whether it is running or stopped.
|
||||
-- If it stopped, you may wish to change the color to red
|
||||
-- to make it stand out
|
||||
return wezterm.format{
|
||||
{Foreground={AnsiColor="Red"}},
|
||||
{Text="docker container named " .. name}
|
||||
return wezterm.format {
|
||||
{ Foreground = { AnsiColor = 'Red' } },
|
||||
{ Text = 'docker container named ' .. name },
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
local exec_domains = {}
|
||||
for id, name in pairs(docker_list()) do
|
||||
table.insert(exec_domains,
|
||||
wezterm.exec_domain("docker: " .. name,
|
||||
table.insert(
|
||||
exec_domains,
|
||||
wezterm.exec_domain(
|
||||
'docker: ' .. name,
|
||||
make_docker_fixup_func(id),
|
||||
make_docker_label_func(id)
|
||||
)
|
||||
@ -196,7 +201,7 @@ for id, name in pairs(docker_list()) do
|
||||
end
|
||||
|
||||
return {
|
||||
exec_domains = exec_domains
|
||||
exec_domains = exec_domains,
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -6,7 +6,7 @@ Splits `pane` and spawns a program into the split, returning the
|
||||
`MuxPane` object associated with it:
|
||||
|
||||
```lua
|
||||
local new_pane = pane:split{}
|
||||
local new_pane = pane:split {}
|
||||
```
|
||||
|
||||
When no arguments are passed, the pane is split in half left/right and the
|
||||
@ -20,7 +20,7 @@ Specifies the argument array for the command that should be spawned.
|
||||
If omitted the default program for the domain will be spawned.
|
||||
|
||||
```lua
|
||||
pane:split{args={"top"}}
|
||||
pane:split { args = { 'top' } }
|
||||
```
|
||||
|
||||
### cwd
|
||||
@ -31,7 +31,7 @@ the program.
|
||||
If unspecified, follows the rules from [default_cwd](../config/default_cwd.md)
|
||||
|
||||
```lua
|
||||
pane:split{cwd="/tmp"}
|
||||
pane:split { cwd = '/tmp' }
|
||||
```
|
||||
|
||||
### set_environment_variables
|
||||
@ -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
|
||||
@ -53,13 +53,13 @@ You may specify the name of one of the multiplexer domains
|
||||
defined in your configuration using the following:
|
||||
|
||||
```lua
|
||||
pane:split{domain={DomainName="my.name"}}
|
||||
pane:split { domain = { DomainName = 'my.name' } }
|
||||
```
|
||||
|
||||
Or you may use the default domain:
|
||||
|
||||
```lua
|
||||
pane:split{domain="DefaultDomain"}
|
||||
pane:split { domain = 'DefaultDomain' }
|
||||
```
|
||||
|
||||
### direction
|
||||
@ -72,7 +72,7 @@ Specifies where the new pane should be placed. Possible values are:
|
||||
* `"Bottom"` - splits the pane top/bottom and places the new pane on the bottom.
|
||||
|
||||
```lua
|
||||
pane:split{direction="Top"}
|
||||
pane:split { direction = 'Top' }
|
||||
```
|
||||
|
||||
### top_level
|
||||
@ -81,7 +81,7 @@ If `true`, rather than splitting `pane` in half, the tab that contains it
|
||||
is split and the new pane runs the full extent of the tab dimensions.
|
||||
|
||||
```lua
|
||||
pane:split{direction="Bottom", top_level=true}
|
||||
pane:split { direction = 'Bottom', top_level = true }
|
||||
```
|
||||
|
||||
### size
|
||||
@ -100,7 +100,7 @@ This creates two additional splits within `pane`, creating three
|
||||
total splits that each occupy 1/3 of the available space:
|
||||
|
||||
```lua
|
||||
pane:split{direction="Top", size=0.333}
|
||||
pane:split{direction="Top", size=0.5}
|
||||
pane:split { direction = 'Top', size = 0.333 }
|
||||
pane:split { direction = 'Top', size = 0.5 }
|
||||
```
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
Sets the tab title to the provided string.
|
||||
|
||||
```lua
|
||||
tab:set_title("my title")
|
||||
tab:set_title 'my title'
|
||||
```
|
||||
|
||||
|
||||
|
@ -39,24 +39,28 @@ local wezterm = require 'wezterm'
|
||||
-- Given "/foo/bar" returns "bar"
|
||||
-- Given "c:\\foo\\bar" returns "bar"
|
||||
function basename(s)
|
||||
return string.gsub(s, "(.*[/\\])(.*)", "%2")
|
||||
return string.gsub(s, '(.*[/\\])(.*)', '%2')
|
||||
end
|
||||
|
||||
wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width)
|
||||
local pane = tab.active_pane
|
||||
local title = basename(pane.foreground_process_name) .. " " .. pane.pane_id
|
||||
local color = "navy"
|
||||
if tab.is_active then
|
||||
color = "blue"
|
||||
wezterm.on(
|
||||
'format-tab-title',
|
||||
function(tab, tabs, panes, config, hover, max_width)
|
||||
local pane = tab.active_pane
|
||||
local title = basename(pane.foreground_process_name)
|
||||
.. ' '
|
||||
.. pane.pane_id
|
||||
local color = 'navy'
|
||||
if tab.is_active then
|
||||
color = 'blue'
|
||||
end
|
||||
return {
|
||||
{ Background = { Color = color } },
|
||||
{ Text = ' ' .. title .. ' ' },
|
||||
}
|
||||
end
|
||||
return {
|
||||
{Background={Color=color}},
|
||||
{Text=" " .. title .. " "},
|
||||
}
|
||||
end)
|
||||
)
|
||||
|
||||
return {
|
||||
}
|
||||
return {}
|
||||
```
|
||||
|
||||
*Since: 20220319-142410-0fcdea07*
|
||||
@ -70,31 +74,33 @@ tab in the tab bar when there is unseen output.
|
||||
```lua
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width)
|
||||
if tab.is_active then
|
||||
return {
|
||||
{Background={Color="blue"}},
|
||||
{Text=" " .. tab.active_pane.title .. " "},
|
||||
}
|
||||
end
|
||||
local has_unseen_output = false
|
||||
for _, pane in ipairs(tab.panes) do
|
||||
if pane.has_unseen_output then
|
||||
has_unseen_output = true
|
||||
break;
|
||||
wezterm.on(
|
||||
'format-tab-title',
|
||||
function(tab, tabs, panes, config, hover, max_width)
|
||||
if tab.is_active then
|
||||
return {
|
||||
{ Background = { Color = 'blue' } },
|
||||
{ Text = ' ' .. tab.active_pane.title .. ' ' },
|
||||
}
|
||||
end
|
||||
local has_unseen_output = false
|
||||
for _, pane in ipairs(tab.panes) do
|
||||
if pane.has_unseen_output then
|
||||
has_unseen_output = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if has_unseen_output then
|
||||
return {
|
||||
{ Background = { Color = 'Orange' } },
|
||||
{ Text = ' ' .. tab.active_pane.title .. ' ' },
|
||||
}
|
||||
end
|
||||
return tab.active_pane.title
|
||||
end
|
||||
if has_unseen_output then
|
||||
return {
|
||||
{Background={Color="Orange"}},
|
||||
{Text=" " .. tab.active_pane.title .. " "},
|
||||
}
|
||||
end
|
||||
return tab.active_pane.title
|
||||
end)
|
||||
)
|
||||
|
||||
return {
|
||||
}
|
||||
return {}
|
||||
```
|
||||
|
||||
*Since: 20220624-141144-bd1b7c5d*
|
||||
@ -115,7 +121,6 @@ wezterm.on('format-tab-title', function(tab)
|
||||
return title
|
||||
end)
|
||||
|
||||
return {
|
||||
}
|
||||
return {}
|
||||
```
|
||||
|
||||
|
@ -7,18 +7,18 @@ It is a lua object with the following fields; all of the fields
|
||||
have reasonable defaults and can be omitted.
|
||||
|
||||
```lua
|
||||
wezterm.action.SpawnCommandInNewWindow{
|
||||
wezterm.action.SpawnCommandInNewWindow {
|
||||
-- An optional label.
|
||||
-- The label is only used for SpawnCommands that are listed in
|
||||
-- the `launch_menu` configuration section.
|
||||
-- If the label is omitted, a default will be produced based
|
||||
-- on the `args` field.
|
||||
label = "List all the files!",
|
||||
label = 'List all the files!',
|
||||
|
||||
-- The argument array specifying the command and its arguments.
|
||||
-- If omitted, the default program for the target domain will be
|
||||
-- spawned.
|
||||
args = {"ls", "-al"},
|
||||
args = { 'ls', '-al' },
|
||||
|
||||
-- The current working directory to set for the command.
|
||||
-- If omitted, wezterm will infer a value based on the active pane
|
||||
@ -29,26 +29,26 @@ wezterm.action.SpawnCommandInNewWindow{
|
||||
-- If the current working directory cannot be inferred then it
|
||||
-- will typically fall back to using the home directory of
|
||||
-- the current user.
|
||||
cwd = "/some/path",
|
||||
cwd = '/some/path',
|
||||
|
||||
-- Sets addditional environment variables in the environment for
|
||||
-- this command invocation.
|
||||
set_environment_variables = {
|
||||
SOMETHING = "a value"
|
||||
SOMETHING = 'a value',
|
||||
},
|
||||
|
||||
-- Specifiy that the multiplexer domain of the currently active pane
|
||||
-- should be used to start this process. This is usually what you
|
||||
-- want to happen and this is the default behavior if you omit
|
||||
-- the domain.
|
||||
domain = "CurrentPaneDomain",
|
||||
domain = 'CurrentPaneDomain',
|
||||
|
||||
-- Specify that the default multiplexer domain be used for this
|
||||
-- command invocation. The default domain is typically the "local"
|
||||
-- domain, which spawns processes locally. However, if you started
|
||||
-- wezterm using `wezterm connect` or `wezterm serial` then the default
|
||||
-- domain will not be "local".
|
||||
domain = "DefaultDomain",
|
||||
domain = 'DefaultDomain',
|
||||
|
||||
-- Specify a named multiplexer domain that should be used to spawn
|
||||
-- this new command.
|
||||
@ -56,7 +56,7 @@ wezterm.action.SpawnCommandInNewWindow{
|
||||
-- a process in a remote multiplexer rather than based on the
|
||||
-- current pane.
|
||||
-- See the Multiplexing section of the docs for more on this topic.
|
||||
domain = {DomainName="my.server"},
|
||||
domain = { DomainName = 'my.server' },
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -8,34 +8,34 @@ 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.
|
||||
name = "my.server",
|
||||
{
|
||||
-- The name of this specific domain. Must be unique amongst
|
||||
-- all types of domain in the configuration file.
|
||||
name = 'my.server',
|
||||
|
||||
-- identifies the host:port pair of the remote server
|
||||
-- Can be a DNS name or an IP address with an optional
|
||||
-- ":port" on the end.
|
||||
remote_address = "192.168.1.1",
|
||||
-- identifies the host:port pair of the remote server
|
||||
-- Can be a DNS name or an IP address with an optional
|
||||
-- ":port" on the end.
|
||||
remote_address = '192.168.1.1',
|
||||
|
||||
-- Whether agent auth should be disabled.
|
||||
-- Set to true to disable it.
|
||||
-- no_agent_auth = false,
|
||||
-- Whether agent auth should be disabled.
|
||||
-- Set to true to disable it.
|
||||
-- no_agent_auth = false,
|
||||
|
||||
-- The username to use for authenticating with the remote host
|
||||
username = "yourusername",
|
||||
-- The username to use for authenticating with the remote host
|
||||
username = 'yourusername',
|
||||
|
||||
-- If true, connect to this domain automatically at startup
|
||||
-- connect_automatically = true,
|
||||
-- If true, connect to this domain automatically at startup
|
||||
-- connect_automatically = true,
|
||||
|
||||
-- Specify an alternative read timeout
|
||||
-- timeout = 60,
|
||||
-- Specify an alternative read timeout
|
||||
-- timeout = 60,
|
||||
|
||||
-- The path to the wezterm binary on the remote host.
|
||||
-- Primarily useful if it isn't installed in the $PATH
|
||||
-- that is configure for ssh.
|
||||
-- remote_wezterm_path = "/home/yourusername/bin/wezterm"
|
||||
},
|
||||
-- The path to the wezterm binary on the remote host.
|
||||
-- Primarily useful if it isn't installed in the $PATH
|
||||
-- that is configure for ssh.
|
||||
-- remote_wezterm_path = "/home/yourusername/bin/wezterm"
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
@ -48,13 +48,13 @@ You may now specify a table with ssh config overrides:
|
||||
return {
|
||||
ssh_domains = {
|
||||
{
|
||||
name = "my.server",
|
||||
remote_address = "192.168.1.1",
|
||||
name = 'my.server',
|
||||
remote_address = '192.168.1.1',
|
||||
ssh_option = {
|
||||
identityfile = "/path/to/id_rsa.pub",
|
||||
}
|
||||
}
|
||||
}
|
||||
identityfile = '/path/to/id_rsa.pub',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -88,27 +88,27 @@ panes and tabs. The following values are recognized for `assume_shell`:
|
||||
return {
|
||||
ssh_domains = {
|
||||
{
|
||||
name = "my.server",
|
||||
remote_address = "192.168.1.1",
|
||||
multiplexing = "None",
|
||||
name = 'my.server',
|
||||
remote_address = '192.168.1.1',
|
||||
multiplexing = 'None',
|
||||
|
||||
-- When multiplexing == "None", default_prog can be used
|
||||
-- to specify the default program to run in new tabs/panes.
|
||||
-- Due to the way that ssh works, you cannot specify default_cwd,
|
||||
-- but you could instead change your default_prog to put you
|
||||
-- in a specific directory.
|
||||
default_prog = {"fish"},
|
||||
default_prog = { 'fish' },
|
||||
|
||||
-- assume that we can use syntax like:
|
||||
-- "env -C /some/where $SHELL"
|
||||
-- using whatever the default command shell is on this
|
||||
-- remote host, so that shell integration will respect
|
||||
-- the current directory on the remote host.
|
||||
assume_shell = "Posix",
|
||||
}
|
||||
assume_shell = 'Posix',
|
||||
},
|
||||
},
|
||||
|
||||
default_domain = "my.server",
|
||||
default_domain = 'my.server',
|
||||
}
|
||||
```
|
||||
|
||||
@ -123,10 +123,10 @@ user. This option only applies when `multiplexing = "WezTerm"`.
|
||||
return {
|
||||
ssh_domains = {
|
||||
{
|
||||
name = "my.server",
|
||||
remote_address = "192.168.1.1",
|
||||
name = 'my.server',
|
||||
remote_address = '192.168.1.1',
|
||||
local_echo_threshold_ms = 10,
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -8,64 +8,64 @@ 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.
|
||||
name = "server.name",
|
||||
{
|
||||
-- The name of this specific domain. Must be unique amongst
|
||||
-- all types of domain in the configuration file.
|
||||
name = 'server.name',
|
||||
|
||||
-- If set, use ssh to connect, start the server, and obtain
|
||||
-- a certificate.
|
||||
-- The value is "user@host:port", just like "wezterm ssh" accepts.
|
||||
bootstrap_via_ssh = "server.hostname",
|
||||
-- If set, use ssh to connect, start the server, and obtain
|
||||
-- a certificate.
|
||||
-- The value is "user@host:port", just like "wezterm ssh" accepts.
|
||||
bootstrap_via_ssh = 'server.hostname',
|
||||
|
||||
-- identifies the host:port pair of the remote server.
|
||||
remote_address = "server.hostname:8080",
|
||||
-- identifies the host:port pair of the remote server.
|
||||
remote_address = 'server.hostname:8080',
|
||||
|
||||
-- the path to an x509 PEM encoded private key file.
|
||||
-- Omit this if you are using `bootstrap_via_ssh`.
|
||||
-- pem_private_key = "/some/path/key.pem",
|
||||
-- the path to an x509 PEM encoded private key file.
|
||||
-- Omit this if you are using `bootstrap_via_ssh`.
|
||||
-- pem_private_key = "/some/path/key.pem",
|
||||
|
||||
-- the path to an x509 PEM encoded certificate file
|
||||
-- Omit this if you are using `bootstrap_via_ssh`.
|
||||
-- pem_cert = "/some/path/cert.pem",
|
||||
-- the path to an x509 PEM encoded certificate file
|
||||
-- Omit this if you are using `bootstrap_via_ssh`.
|
||||
-- pem_cert = "/some/path/cert.pem",
|
||||
|
||||
-- the path to an x509 PEM encoded CA chain file
|
||||
-- Omit this if you are using `bootstrap_via_ssh`.
|
||||
-- pem_ca = "/some/path/ca.pem",
|
||||
-- the path to an x509 PEM encoded CA chain file
|
||||
-- Omit this if you are using `bootstrap_via_ssh`.
|
||||
-- pem_ca = "/some/path/ca.pem",
|
||||
|
||||
-- A set of paths to load additional CA certificates.
|
||||
-- Each entry can be either the path to a directory or to a PEM encoded
|
||||
-- CA file. If an entry is a directory, then its contents will be
|
||||
-- loaded as CA certs and added to the trust store.
|
||||
-- Omit this if you are using `bootstrap_via_ssh`.
|
||||
-- pem_root_certs = { "/some/path/ca1.pem", "/some/path/ca2.pem" },
|
||||
-- A set of paths to load additional CA certificates.
|
||||
-- Each entry can be either the path to a directory or to a PEM encoded
|
||||
-- CA file. If an entry is a directory, then its contents will be
|
||||
-- loaded as CA certs and added to the trust store.
|
||||
-- Omit this if you are using `bootstrap_via_ssh`.
|
||||
-- pem_root_certs = { "/some/path/ca1.pem", "/some/path/ca2.pem" },
|
||||
|
||||
-- explicitly control whether the client checks that the certificate
|
||||
-- presented by the server matches the hostname portion of
|
||||
-- `remote_address`. The default is true. This option is made
|
||||
-- available for troubleshooting purposes and should not be used outside
|
||||
-- of a controlled environment as it weakens the security of the TLS
|
||||
-- channel.
|
||||
-- accept_invalid_hostnames = false,
|
||||
-- explicitly control whether the client checks that the certificate
|
||||
-- presented by the server matches the hostname portion of
|
||||
-- `remote_address`. The default is true. This option is made
|
||||
-- available for troubleshooting purposes and should not be used outside
|
||||
-- of a controlled environment as it weakens the security of the TLS
|
||||
-- channel.
|
||||
-- accept_invalid_hostnames = false,
|
||||
|
||||
-- the hostname string that we expect to match against the common name
|
||||
-- field in the certificate presented by the server. This defaults to
|
||||
-- the hostname portion of the `remote_address` configuration and you
|
||||
-- should not normally need to override this value.
|
||||
-- expected_cn = "other.name",
|
||||
-- the hostname string that we expect to match against the common name
|
||||
-- field in the certificate presented by the server. This defaults to
|
||||
-- the hostname portion of the `remote_address` configuration and you
|
||||
-- should not normally need to override this value.
|
||||
-- expected_cn = "other.name",
|
||||
|
||||
-- If true, connect to this domain automatically at startup
|
||||
-- connect_automatically = false,
|
||||
-- If true, connect to this domain automatically at startup
|
||||
-- connect_automatically = false,
|
||||
|
||||
-- Specify an alternate read timeout
|
||||
-- read_timeout = 60,
|
||||
-- Specify an alternate read timeout
|
||||
-- read_timeout = 60,
|
||||
|
||||
-- Specify an alternate write timeout
|
||||
-- write_timeout = 60,
|
||||
-- Specify an alternate write timeout
|
||||
-- write_timeout = 60,
|
||||
|
||||
-- The path to the wezterm binary on the remote host
|
||||
-- remote_wezterm_path = "/home/myname/bin/wezterm"
|
||||
},
|
||||
-- The path to the wezterm binary on the remote host
|
||||
-- remote_wezterm_path = "/home/myname/bin/wezterm"
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
@ -83,11 +83,11 @@ user. This option only applies when `multiplexing = "WezTerm"`.
|
||||
return {
|
||||
tls_domains = {
|
||||
{
|
||||
name = "server,name",
|
||||
bootstrap_via_ssh = "server.hostname",
|
||||
remote_address = "server.hostname:8080",
|
||||
name = 'server,name',
|
||||
bootstrap_via_ssh = 'server.hostname',
|
||||
remote_address = 'server.hostname:8080',
|
||||
local_echo_threshold_ms = 10,
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -8,31 +8,31 @@ 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
|
||||
bind_address = "server.hostname:8080",
|
||||
{
|
||||
-- The address:port combination on which the server will listen
|
||||
-- for client connections
|
||||
bind_address = 'server.hostname:8080',
|
||||
|
||||
-- the path to an x509 PEM encoded private key file.
|
||||
-- You can omit this if your tls_client is using bootstrap_via_ssh.
|
||||
-- pem_private_key = "/path/to/key.pem",
|
||||
-- the path to an x509 PEM encoded private key file.
|
||||
-- You can omit this if your tls_client is using bootstrap_via_ssh.
|
||||
-- pem_private_key = "/path/to/key.pem",
|
||||
|
||||
-- the path to an x509 PEM encoded certificate file.
|
||||
-- You can omit this if your tls_client is using bootstrap_via_ssh.
|
||||
-- pem_cert = "/path/to/cert.pem",
|
||||
-- the path to an x509 PEM encoded certificate file.
|
||||
-- You can omit this if your tls_client is using bootstrap_via_ssh.
|
||||
-- pem_cert = "/path/to/cert.pem",
|
||||
|
||||
-- the path to an x509 PEM encoded CA chain file.
|
||||
-- You can omit this if your tls_client is using bootstrap_via_ssh.
|
||||
-- pem_ca = "/path/to/chain.pem",
|
||||
-- the path to an x509 PEM encoded CA chain file.
|
||||
-- You can omit this if your tls_client is using bootstrap_via_ssh.
|
||||
-- pem_ca = "/path/to/chain.pem",
|
||||
|
||||
-- A set of paths to load additional CA certificates.
|
||||
-- Each entry can be either the path to a directory
|
||||
-- or to a PEM encoded CA file. If an entry is a directory,
|
||||
-- then its contents will be loaded as CA certs and added
|
||||
-- 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" },
|
||||
},
|
||||
-- A set of paths to load additional CA certificates.
|
||||
-- Each entry can be either the path to a directory
|
||||
-- or to a PEM encoded CA file. If an entry is a directory,
|
||||
-- then its contents will be loaded as CA certs and added
|
||||
-- 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" },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -20,36 +20,33 @@ 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.
|
||||
name = "WSL:Ubuntu-18.04",
|
||||
{
|
||||
-- The name of this specific domain. Must be unique amonst all types
|
||||
-- of domain in the configuration file.
|
||||
name = 'WSL:Ubuntu-18.04',
|
||||
|
||||
-- The name of the distribution. This identifies the WSL distribution.
|
||||
-- It must match a valid distribution from your `wsl -l -v` output in
|
||||
-- order for the domain to be useful.
|
||||
distribution = "Ubuntu-18.04",
|
||||
-- The name of the distribution. This identifies the WSL distribution.
|
||||
-- It must match a valid distribution from your `wsl -l -v` output in
|
||||
-- order for the domain to be useful.
|
||||
distribution = 'Ubuntu-18.04',
|
||||
|
||||
-- The username to use when spawning commands in the distribution.
|
||||
-- If omitted, the default user for that distribution will be used.
|
||||
|
||||
-- The username to use when spawning commands in the distribution.
|
||||
-- If omitted, the default user for that distribution will be used.
|
||||
-- username = "hunter",
|
||||
|
||||
-- username = "hunter",
|
||||
-- The current working directory to use when spawning commands, if
|
||||
-- the SpawnCommand doesn't otherwise specify the directory.
|
||||
|
||||
-- default_cwd = "/tmp"
|
||||
|
||||
-- The current working directory to use when spawning commands, if
|
||||
-- the SpawnCommand doesn't otherwise specify the directory.
|
||||
-- The default command to run, if the SpawnCommand doesn't otherwise
|
||||
-- override it. Note that you may prefer to use `chsh` to set the
|
||||
-- default shell for your user inside WSL to avoid needing to
|
||||
-- specify it here
|
||||
|
||||
-- default_cwd = "/tmp"
|
||||
|
||||
|
||||
-- The default command to run, if the SpawnCommand doesn't otherwise
|
||||
-- override it. Note that you may prefer to use `chsh` to set the
|
||||
-- default shell for your user inside WSL to avoid needing to
|
||||
-- specify it here
|
||||
|
||||
-- default_prog = {"fish"}
|
||||
},
|
||||
-- default_prog = {"fish"}
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -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()
|
||||
```
|
||||
|
||||
|
||||
|
@ -16,8 +16,8 @@ transitions:
|
||||
```lua
|
||||
return {
|
||||
animation_fps = 1,
|
||||
cursor_blink_ease_in = "Constant",
|
||||
cursor_blink_ease_out = "Constant",
|
||||
cursor_blink_ease_in = 'Constant',
|
||||
cursor_blink_ease_out = 'Constant',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -11,6 +11,6 @@ For example, to disable auto config reload:
|
||||
|
||||
```lua
|
||||
return {
|
||||
automatically_reload_config = false
|
||||
automatically_reload_config = false,
|
||||
}
|
||||
```
|
||||
|
@ -102,75 +102,85 @@ The video at the top of this page demonstrate this configuration in action.
|
||||
```lua
|
||||
-- The art is a bit too bright and colorful to be useful as a backdrop
|
||||
-- for text, so we're going to dim it down to 10% of its normal brightness
|
||||
local dimmer = {brightness=0.1}
|
||||
local dimmer = { brightness = 0.1 }
|
||||
|
||||
return {
|
||||
enable_scroll_bar = true,
|
||||
min_scroll_bar_height = "2cell",
|
||||
min_scroll_bar_height = '2cell',
|
||||
colors = {
|
||||
scrollbar_thumb = "white",
|
||||
scrollbar_thumb = 'white',
|
||||
},
|
||||
background = {
|
||||
-- This is the deepest/back-most layer. It will be rendered first
|
||||
{
|
||||
source = {File="/Alien_Ship_bg_vert_images/Backgrounds/spaceship_bg_1.png"},
|
||||
source = {
|
||||
File = '/Alien_Ship_bg_vert_images/Backgrounds/spaceship_bg_1.png',
|
||||
},
|
||||
-- The texture tiles vertically but not horizontally.
|
||||
-- When we repeat it, mirror it so that it appears "more seamless".
|
||||
-- An alternative to this is to set `width = "100%"` and have
|
||||
-- it stretch across the display
|
||||
repeat_x = "Mirror",
|
||||
repeat_x = 'Mirror',
|
||||
hsb = dimmer,
|
||||
-- When the viewport scrolls, move this layer 10% of the number of
|
||||
-- pixels moved by the main viewport. This makes it appear to be
|
||||
-- further behind the text.
|
||||
attachment = {Parallax=0.1},
|
||||
attachment = { Parallax = 0.1 },
|
||||
},
|
||||
-- Subsequent layers are rendered over the top of each other
|
||||
{
|
||||
source = {File="/Alien_Ship_bg_vert_images/Overlays/overlay_1_spines.png"},
|
||||
width = "100%",
|
||||
repeat_x = "NoRepeat",
|
||||
source = {
|
||||
File = '/Alien_Ship_bg_vert_images/Overlays/overlay_1_spines.png',
|
||||
},
|
||||
width = '100%',
|
||||
repeat_x = 'NoRepeat',
|
||||
|
||||
-- position the spins starting at the bottom, and repeating every
|
||||
-- two screens.
|
||||
vertical_align = "Bottom",
|
||||
repeat_y_size = "200%",
|
||||
vertical_align = 'Bottom',
|
||||
repeat_y_size = '200%',
|
||||
hsb = dimmer,
|
||||
|
||||
-- The parallax factor is higher than the background layer, so this
|
||||
-- one will appear to be closer when we scroll
|
||||
attachment = {Parallax=0.2},
|
||||
attachment = { Parallax = 0.2 },
|
||||
},
|
||||
{
|
||||
source = {File="/Alien_Ship_bg_vert_images/Overlays/overlay_2_alienball.png"},
|
||||
width = "100%",
|
||||
repeat_x = "NoRepeat",
|
||||
source = {
|
||||
File = '/Alien_Ship_bg_vert_images/Overlays/overlay_2_alienball.png',
|
||||
},
|
||||
width = '100%',
|
||||
repeat_x = 'NoRepeat',
|
||||
|
||||
-- start at 10% of the screen and repeat every 2 screens
|
||||
vertical_offset = "10%",
|
||||
repeat_y_size = "200%",
|
||||
vertical_offset = '10%',
|
||||
repeat_y_size = '200%',
|
||||
hsb = dimmer,
|
||||
attachment = {Parallax=0.3},
|
||||
attachment = { Parallax = 0.3 },
|
||||
},
|
||||
{
|
||||
source = {File="/Alien_Ship_bg_vert_images/Overlays/overlay_3_lobster.png"},
|
||||
width = "100%",
|
||||
repeat_x = "NoRepeat",
|
||||
source = {
|
||||
File = '/Alien_Ship_bg_vert_images/Overlays/overlay_3_lobster.png',
|
||||
},
|
||||
width = '100%',
|
||||
repeat_x = 'NoRepeat',
|
||||
|
||||
vertical_offset = "30%",
|
||||
repeat_y_size = "200%",
|
||||
vertical_offset = '30%',
|
||||
repeat_y_size = '200%',
|
||||
hsb = dimmer,
|
||||
attachment = {Parallax=0.4},
|
||||
attachment = { Parallax = 0.4 },
|
||||
},
|
||||
{
|
||||
source = {File="/Alien_Ship_bg_vert_images/Overlays/overlay_4_spiderlegs.png"},
|
||||
width = "100%",
|
||||
repeat_x = "NoRepeat",
|
||||
source = {
|
||||
File = '/Alien_Ship_bg_vert_images/Overlays/overlay_4_spiderlegs.png',
|
||||
},
|
||||
width = '100%',
|
||||
repeat_x = 'NoRepeat',
|
||||
|
||||
vertical_offset = "50%",
|
||||
repeat_y_size = "150%",
|
||||
vertical_offset = '50%',
|
||||
repeat_y_size = '150%',
|
||||
hsb = dimmer,
|
||||
attachment = {Parallax=0.5},
|
||||
attachment = { Parallax = 0.5 },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -18,6 +18,6 @@ assignments.
|
||||
```lua
|
||||
return {
|
||||
-- Use ALT instead of SHIFT to bypass application mouse reporting
|
||||
bypass_mouse_reporting_modifiers = "ALT"
|
||||
bypass_mouse_reporting_modifiers = 'ALT',
|
||||
}
|
||||
```
|
||||
|
@ -16,7 +16,7 @@ to set this config to treat `130` as OK:
|
||||
|
||||
```lua
|
||||
return {
|
||||
clean_exit_codes = {130},
|
||||
clean_exit_codes = { 130 },
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -14,9 +14,9 @@ There are three fields supported:
|
||||
```lua
|
||||
return {
|
||||
daemon_options = {
|
||||
stdout = "/some/where/stdout",
|
||||
stderr = "/some/where/stderr",
|
||||
pid_file = "/some/where/pid_file",
|
||||
}
|
||||
stdout = '/some/where/stdout',
|
||||
stderr = '/some/where/stderr',
|
||||
pid_file = '/some/where/pid_file',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -12,7 +12,7 @@ and `BlinkingBar`.
|
||||
|
||||
```lua
|
||||
return {
|
||||
default_cursor_style = "SteadyBlock",
|
||||
default_cursor_style = 'SteadyBlock',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -28,7 +28,7 @@ and if I set my config like this:
|
||||
|
||||
```lua
|
||||
return {
|
||||
default_domain = "WSL:Ubuntu-18.04",
|
||||
default_domain = 'WSL:Ubuntu-18.04',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -14,7 +14,7 @@ particular host, then you might consider using this configuration:
|
||||
|
||||
```lua
|
||||
return {
|
||||
default_gui_startup_args = {"ssh", "some-host"},
|
||||
default_gui_startup_args = { 'ssh', 'some-host' },
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ you'd use this:
|
||||
|
||||
```lua
|
||||
return {
|
||||
default_prog = {"top"}
|
||||
default_prog = { 'top' },
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -11,7 +11,7 @@ There are three possible values:
|
||||
|
||||
```lua
|
||||
return {
|
||||
exit_behavior = "Hold",
|
||||
exit_behavior = 'Hold',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -11,7 +11,7 @@ return {
|
||||
-- `fonts` that is found alongside your `wezterm.lua` file.
|
||||
-- As this option is an array, you may list multiple locations if
|
||||
-- you wish.
|
||||
font_dirs = {"fonts"},
|
||||
font_dirs = { 'fonts' },
|
||||
}
|
||||
```
|
||||
|
||||
@ -28,7 +28,7 @@ then you can set:
|
||||
|
||||
```lua
|
||||
return {
|
||||
font_locator = "ConfigDirsOnly",
|
||||
font_locator = 'ConfigDirsOnly',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -10,7 +10,7 @@ If you do specify `font_rules`, they are applied in the order that they are
|
||||
specified in the configuration file, stopping with the first matching rule:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
return {
|
||||
font_rules = {
|
||||
-- Define a rule that matches when italic text is shown
|
||||
@ -39,49 +39,52 @@ return {
|
||||
-- invisible = false,
|
||||
|
||||
-- When the above attributes match, apply this font styling
|
||||
font = wezterm.font("Operator Mono SSm Lig Medium", {italic=true}),
|
||||
}
|
||||
}
|
||||
font = wezterm.font('Operator Mono SSm Lig Medium', { italic = true }),
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
Here's an example from my configuration file;
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
-- A helper function for my fallback fonts
|
||||
function font_with_fallback(name, params)
|
||||
local names = {name, "Noto Color Emoji", "JetBrains Mono"}
|
||||
local names = { name, 'Noto Color Emoji', 'JetBrains Mono' }
|
||||
return wezterm.font_with_fallback(names, params)
|
||||
end
|
||||
|
||||
return {
|
||||
font = font_with_fallback("Operator Mono SSm Lig Medium"),
|
||||
font_rules= {
|
||||
font = font_with_fallback 'Operator Mono SSm Lig Medium',
|
||||
font_rules = {
|
||||
-- Select a fancy italic font for italic text
|
||||
{
|
||||
italic = true,
|
||||
font = font_with_fallback("Operator Mono SSm Lig Medium Italic"),
|
||||
font = font_with_fallback 'Operator Mono SSm Lig Medium Italic',
|
||||
},
|
||||
|
||||
-- Similarly, a fancy bold+italic font
|
||||
{
|
||||
italic = true,
|
||||
intensity = "Bold",
|
||||
font = font_with_fallback("Operator Mono SSm Lig Book Italic"),
|
||||
intensity = 'Bold',
|
||||
font = font_with_fallback 'Operator Mono SSm Lig Book Italic',
|
||||
},
|
||||
|
||||
-- Make regular bold text a different color to make it stand out even more
|
||||
{
|
||||
intensity = "Bold",
|
||||
font = font_with_fallback("Operator Mono SSm Lig Bold", {foreground = "tomato"}),
|
||||
intensity = 'Bold',
|
||||
font = font_with_fallback(
|
||||
'Operator Mono SSm Lig Bold',
|
||||
{ foreground = 'tomato' }
|
||||
),
|
||||
},
|
||||
|
||||
-- For half-intensity text, use a lighter weight font
|
||||
{
|
||||
intensity = "Half",
|
||||
font = font_with_fallback("Operator Mono SSm Lig Light"),
|
||||
intensity = 'Half',
|
||||
font = font_with_fallback 'Operator Mono SSm Lig Light',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ return {
|
||||
hue = 1.0,
|
||||
saturation = 1.5,
|
||||
brightness = 1.0,
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ Available flags are:
|
||||
return {
|
||||
-- You probably don't want to do this, but this demonstrates
|
||||
-- that the flags can be combined
|
||||
freetype_load_flags = "NO_HINTING|MONOCHROME"
|
||||
freetype_load_flags = 'NO_HINTING|MONOCHROME',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -14,8 +14,8 @@ subpixel-antialiased glyph bitmaps:
|
||||
|
||||
```lua
|
||||
return {
|
||||
freetype_load_target = "Light",
|
||||
freetype_render_target = "HorizontalLcd",
|
||||
freetype_load_target = 'Light',
|
||||
freetype_render_target = 'HorizontalLcd',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -26,7 +26,7 @@ You can control IME preedit rendering in your configuraiton file:
|
||||
|
||||
```lua
|
||||
return {
|
||||
ime_preedit_rendering = "System",
|
||||
ime_preedit_rendering = 'System',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -14,15 +14,15 @@ Each entry in `launch_menu` is an instance of a
|
||||
return {
|
||||
launch_menu = {
|
||||
{
|
||||
args = {"top"},
|
||||
args = { 'top' },
|
||||
},
|
||||
{
|
||||
-- Optional label to show in the launcher. If omitted, a label
|
||||
-- is derived from the `args`
|
||||
label = "Bash",
|
||||
label = 'Bash',
|
||||
-- The argument array to spawn. If omitted the default program
|
||||
-- will be used as described in the documentation above
|
||||
args = {"bash", "-l"},
|
||||
args = { 'bash', '-l' },
|
||||
|
||||
-- You can specify an alternative current working directory;
|
||||
-- if you don't specify one then a default based on the OSC 7
|
||||
@ -35,7 +35,7 @@ return {
|
||||
-- set_environment_variables configuration option described above
|
||||
-- set_environment_variables = { FOO = "bar" },
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -14,9 +14,9 @@ The default value for this is:
|
||||
```lua
|
||||
return {
|
||||
mux_env_remove = {
|
||||
"SSH_AUTH_SOCK",
|
||||
"SSH_CLIENT",
|
||||
"SSH_CONNECTION",
|
||||
}
|
||||
'SSH_AUTH_SOCK',
|
||||
'SSH_CLIENT',
|
||||
'SSH_CONNECTION',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -10,8 +10,8 @@ return {
|
||||
quick_select_patterns = {
|
||||
-- match things that look like sha1 hashes
|
||||
-- (this is actually one of the default patterns)
|
||||
"[0-9a-f]{7,40}",
|
||||
}
|
||||
'[0-9a-f]{7,40}',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -11,6 +11,6 @@ Defaults to ``" \t\n{}[]()\"'`"``.
|
||||
For example, to always include spaces and newline when selecting a word, but stop on punctuations:
|
||||
```lua
|
||||
return {
|
||||
selection_word_boundary = "{}[]()\"'`.,;:"
|
||||
selection_word_boundary = '{}[]()"\'`.,;:',
|
||||
}
|
||||
```
|
||||
|
@ -17,8 +17,12 @@ The default value for this setting is shown below:
|
||||
```lua
|
||||
return {
|
||||
skip_close_confirmation_for_processes_named = {
|
||||
"bash", "sh", "zsh", "fish", "tmux"
|
||||
}
|
||||
'bash',
|
||||
'sh',
|
||||
'zsh',
|
||||
'fish',
|
||||
'tmux',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -31,16 +35,16 @@ processes:
|
||||
```lua
|
||||
return {
|
||||
skip_close_confirmation_for_processes_named = {
|
||||
"bash",
|
||||
"sh",
|
||||
"zsh",
|
||||
"fish",
|
||||
"tmux",
|
||||
"nu",
|
||||
"cmd.exe",
|
||||
"pwsh.exe",
|
||||
"powershell.exe"
|
||||
}
|
||||
'bash',
|
||||
'sh',
|
||||
'zsh',
|
||||
'fish',
|
||||
'tmux',
|
||||
'nu',
|
||||
'cmd.exe',
|
||||
'pwsh.exe',
|
||||
'powershell.exe',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -39,7 +39,7 @@ This example changes the tab edges to the PowerLine arrow symbols:
|
||||
alt="Demonstrating setting the styling of the left and right tab edges">
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
-- The filled in variant of the < symbol
|
||||
local SOLID_LEFT_ARROW = utf8.char(0xe0b2)
|
||||
@ -49,27 +49,27 @@ local SOLID_RIGHT_ARROW = utf8.char(0xe0b0)
|
||||
|
||||
return {
|
||||
tab_bar_style = {
|
||||
active_tab_left = wezterm.format({
|
||||
{Background={Color="#0b0022"}},
|
||||
{Foreground={Color="#2b2042"}},
|
||||
{Text=SOLID_LEFT_ARROW},
|
||||
}),
|
||||
active_tab_right = wezterm.format({
|
||||
{Background={Color="#0b0022"}},
|
||||
{Foreground={Color="#2b2042"}},
|
||||
{Text=SOLID_RIGHT_ARROW},
|
||||
}),
|
||||
inactive_tab_left = wezterm.format({
|
||||
{Background={Color="#0b0022"}},
|
||||
{Foreground={Color="#1b1032"}},
|
||||
{Text=SOLID_LEFT_ARROW},
|
||||
}),
|
||||
inactive_tab_right = wezterm.format({
|
||||
{Background={Color="#0b0022"}},
|
||||
{Foreground={Color="#1b1032"}},
|
||||
{Text=SOLID_RIGHT_ARROW},
|
||||
}),
|
||||
}
|
||||
active_tab_left = wezterm.format {
|
||||
{ Background = { Color = '#0b0022' } },
|
||||
{ Foreground = { Color = '#2b2042' } },
|
||||
{ Text = SOLID_LEFT_ARROW },
|
||||
},
|
||||
active_tab_right = wezterm.format {
|
||||
{ Background = { Color = '#0b0022' } },
|
||||
{ Foreground = { Color = '#2b2042' } },
|
||||
{ Text = SOLID_RIGHT_ARROW },
|
||||
},
|
||||
inactive_tab_left = wezterm.format {
|
||||
{ Background = { Color = '#0b0022' } },
|
||||
{ Foreground = { Color = '#1b1032' } },
|
||||
{ Text = SOLID_LEFT_ARROW },
|
||||
},
|
||||
inactive_tab_right = wezterm.format {
|
||||
{ Background = { Color = '#0b0022' } },
|
||||
{ Foreground = { Color = '#1b1032' } },
|
||||
{ Text = SOLID_RIGHT_ARROW },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -30,10 +30,10 @@ The following snippet works if you installed `wezterm.terminfo` with nix into yo
|
||||
|
||||
```lua
|
||||
return {
|
||||
set_environment_variables={
|
||||
TERMINFO_DIRS='/home/user/.nix-profile/share/terminfo',
|
||||
WSLENV='TERMINFO_DIRS'
|
||||
set_environment_variables = {
|
||||
TERMINFO_DIRS = '/home/user/.nix-profile/share/terminfo',
|
||||
WSLENV = 'TERMINFO_DIRS',
|
||||
},
|
||||
term = "wezterm",
|
||||
term = 'wezterm',
|
||||
}
|
||||
```
|
||||
|
@ -10,7 +10,7 @@ interval specified with some degree of slop.
|
||||
|
||||
```lua
|
||||
return {
|
||||
text_blink_rate = 500
|
||||
text_blink_rate = 500,
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -10,7 +10,7 @@ interval specified with some degree of slop.
|
||||
|
||||
```lua
|
||||
return {
|
||||
text_blink_rate_rapid = 250
|
||||
text_blink_rate_rapid = 250,
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -12,6 +12,6 @@ bindings using separate Ctrl and Alt won't be triggered anymore.
|
||||
|
||||
```lua
|
||||
return {
|
||||
treat_left_ctrlalt_as_altgr = true
|
||||
treat_left_ctrlalt_as_altgr = true,
|
||||
}
|
||||
```
|
||||
|
@ -34,13 +34,13 @@ The following configuration enables a low intensity visual bell that takes a tot
|
||||
```lua
|
||||
return {
|
||||
visual_bell = {
|
||||
fade_in_function = "EaseIn",
|
||||
fade_in_function = 'EaseIn',
|
||||
fade_in_duration_ms = 150,
|
||||
fade_out_function = "EaseOut",
|
||||
fade_out_function = 'EaseOut',
|
||||
fade_out_duration_ms = 150,
|
||||
},
|
||||
colors = {
|
||||
visual_bell = "#202020"
|
||||
visual_bell = '#202020',
|
||||
},
|
||||
}
|
||||
```
|
||||
@ -52,7 +52,7 @@ return {
|
||||
visual_bell = {
|
||||
fade_in_duration_ms = 75,
|
||||
fade_out_duration_ms = 75,
|
||||
target = "CursorColor",
|
||||
target = 'CursorColor',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -16,15 +16,15 @@ return {
|
||||
-- with the gradient going from left-to-right.
|
||||
-- Linear and Radial gradients are also supported; see the other
|
||||
-- examples below
|
||||
orientation = "Vertical",
|
||||
orientation = 'Vertical',
|
||||
|
||||
-- Specifies the set of colors that are interpolated in the gradient.
|
||||
-- Accepts CSS style color specs, from named colors, through rgb
|
||||
-- strings and more
|
||||
colors = {
|
||||
"#0f0c29",
|
||||
"#302b63",
|
||||
"#24243e"
|
||||
'#0f0c29',
|
||||
'#302b63',
|
||||
'#24243e',
|
||||
},
|
||||
|
||||
-- Instead of specifying `colors`, you can use one of a number of
|
||||
@ -35,12 +35,12 @@ return {
|
||||
-- Specifies the interpolation style to be used.
|
||||
-- "Linear", "Basis" and "CatmullRom" as supported.
|
||||
-- The default is "Linear".
|
||||
interpolation = "Linear",
|
||||
interpolation = 'Linear',
|
||||
|
||||
-- How the colors are blended in the gradient.
|
||||
-- "Rgb", "LinearRgb", "Hsv" and "Oklab" are supported.
|
||||
-- The default is "Rgb".
|
||||
blend = "Rgb",
|
||||
blend = 'Rgb',
|
||||
|
||||
-- To avoid vertical color banding for horizontal gradients, the
|
||||
-- gradient position is randomly shifted by up to the `noise` value
|
||||
@ -88,10 +88,10 @@ that is moving from the top left corner down to the bottom right corner.
|
||||
```lua
|
||||
return {
|
||||
window_background_gradient = {
|
||||
colors = { "#EEBD89", "#D13ABD" },
|
||||
colors = { '#EEBD89', '#D13ABD' },
|
||||
-- Specifices a Linear gradient starting in the top left corner.
|
||||
orientation = { Linear = { angle = -45.0 } },
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -104,30 +104,30 @@ subsequently stretched to fill the dimensions of the window.
|
||||
|
||||
```lua
|
||||
return {
|
||||
color_scheme = "Github",
|
||||
color_scheme = 'Github',
|
||||
window_background_gradient = {
|
||||
colors = {"deeppink", "gold"},
|
||||
orientation = {
|
||||
Radial={
|
||||
-- Specifies the x coordinate of the center of the circle,
|
||||
-- in the range 0.0 through 1.0. The default is 0.5 which
|
||||
-- is centered in the X dimension.
|
||||
cx = 0.75,
|
||||
colors = { 'deeppink', 'gold' },
|
||||
orientation = {
|
||||
Radial = {
|
||||
-- Specifies the x coordinate of the center of the circle,
|
||||
-- in the range 0.0 through 1.0. The default is 0.5 which
|
||||
-- is centered in the X dimension.
|
||||
cx = 0.75,
|
||||
|
||||
-- Specifies the y coordinate of the center of the circle,
|
||||
-- in the range 0.0 through 1.0. The default is 0.5 which
|
||||
-- is centered in the Y dimension.
|
||||
cy = 0.75,
|
||||
-- Specifies the y coordinate of the center of the circle,
|
||||
-- in the range 0.0 through 1.0. The default is 0.5 which
|
||||
-- is centered in the Y dimension.
|
||||
cy = 0.75,
|
||||
|
||||
-- Specifies the radius of the notional circle.
|
||||
-- The default is 0.5, which combined with the default cx
|
||||
-- and cy values places the circle in the center of the
|
||||
-- window, with the edges touching the window edges.
|
||||
-- Values larger than 1 are possible.
|
||||
radius = 1.25,
|
||||
}
|
||||
},
|
||||
}
|
||||
-- Specifies the radius of the notional circle.
|
||||
-- The default is 0.5, which combined with the default cx
|
||||
-- and cy values places the circle in the center of the
|
||||
-- window, with the edges touching the window edges.
|
||||
-- Values larger than 1 are possible.
|
||||
radius = 1.25,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -9,7 +9,7 @@ windows every time.
|
||||
|
||||
```lua
|
||||
return {
|
||||
window_close_confirmation = "AlwaysPrompt",
|
||||
window_close_confirmation = 'AlwaysPrompt',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -9,16 +9,16 @@ It allows you to customize the colors of the window frame.
|
||||
```lua
|
||||
return {
|
||||
window_frame = {
|
||||
inactive_titlebar_bg = "#353535",
|
||||
active_titlebar_bg = "#2b2042",
|
||||
inactive_titlebar_fg = "#cccccc",
|
||||
active_titlebar_fg = "#ffffff",
|
||||
inactive_titlebar_border_bottom = "#2b2042",
|
||||
active_titlebar_border_bottom = "#2b2042",
|
||||
button_fg = "#cccccc",
|
||||
button_bg = "#2b2042",
|
||||
button_hover_fg = "#ffffff",
|
||||
button_hover_bg = "#3b3052",
|
||||
}
|
||||
inactive_titlebar_bg = '#353535',
|
||||
active_titlebar_bg = '#2b2042',
|
||||
inactive_titlebar_fg = '#cccccc',
|
||||
active_titlebar_fg = '#ffffff',
|
||||
inactive_titlebar_border_bottom = '#2b2042',
|
||||
active_titlebar_border_bottom = '#2b2042',
|
||||
button_fg = '#cccccc',
|
||||
button_bg = '#2b2042',
|
||||
button_hover_fg = '#ffffff',
|
||||
button_hover_bg = '#3b3052',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -17,7 +17,7 @@ return {
|
||||
right = 2,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -38,11 +38,11 @@ The default padding is shown below. In earlier releases, the default padding wa
|
||||
```lua
|
||||
return {
|
||||
window_padding = {
|
||||
left = "1cell",
|
||||
right = "1cell",
|
||||
top = "0.5cell",
|
||||
bottom = "0.5cell",
|
||||
}
|
||||
left = '1cell',
|
||||
right = '1cell',
|
||||
top = '0.5cell',
|
||||
bottom = '0.5cell',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -14,7 +14,7 @@ update your config to specify it explicitly:
|
||||
|
||||
```lua
|
||||
return {
|
||||
xim_im_name = "fcitx",
|
||||
xim_im_name = 'fcitx',
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -5,9 +5,9 @@ the configuration file. These are provided by the `wezterm` module that must
|
||||
be imported into your configuration file:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
return {
|
||||
font = wezterm.font("JetBrains Mono"),
|
||||
font = wezterm.font 'JetBrains Mono',
|
||||
}
|
||||
```
|
||||
|
||||
@ -29,7 +29,7 @@ you would place it in `~/.config/wezterm/helpers.lua` with contents like this:
|
||||
```lua
|
||||
-- I am helpers.lua and I should live in ~/.config/wezterm/helpers.lua
|
||||
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
-- This is the module table that we will export
|
||||
local module = {}
|
||||
@ -37,7 +37,7 @@ local module = {}
|
||||
-- This function is private to this module and is not visible
|
||||
-- outside.
|
||||
local function private_helper()
|
||||
wezterm.log_error("hello!")
|
||||
wezterm.log_error 'hello!'
|
||||
end
|
||||
|
||||
-- define a function in the module table.
|
||||
@ -55,6 +55,6 @@ and then in your `wezterm.lua`
|
||||
you would use it like this:
|
||||
|
||||
```lua
|
||||
local helpers = require 'helpers';
|
||||
local helpers = require 'helpers'
|
||||
helpers.my_function()
|
||||
```
|
||||
|
@ -21,14 +21,14 @@ This basic example splits an initial window into thirds:
|
||||
local wezterm = require 'wezterm'
|
||||
local mux = wezterm.mux
|
||||
|
||||
wezterm.on("gui-startup", function()
|
||||
local tab, pane, window = mux.spawn_window{}
|
||||
wezterm.on('gui-startup', function()
|
||||
local tab, pane, window = mux.spawn_window {}
|
||||
-- Create a split occupying the right 1/3 of the screen
|
||||
pane:split{size=0.3}
|
||||
pane:split { size = 0.3 }
|
||||
-- Create another split in the right of the remaining 2/3
|
||||
-- of the space; the resultant split is in the middle
|
||||
-- 1/3 of the display and has the focus.
|
||||
pane:split{size=0.5}
|
||||
pane:split { size = 0.5 }
|
||||
end)
|
||||
|
||||
return {}
|
||||
@ -40,8 +40,8 @@ This example creates a default window but makes it maximize on startup:
|
||||
local wezterm = require 'wezterm'
|
||||
local mux = wezterm.mux
|
||||
|
||||
wezterm.on("gui-startup", function()
|
||||
local tab, pane, window = mux.spawn_window{}
|
||||
wezterm.on('gui-startup', function()
|
||||
local tab, pane, window = mux.spawn_window {}
|
||||
window:gui_window():maximize()
|
||||
end)
|
||||
|
||||
@ -54,31 +54,31 @@ Here's a more elaborate example that configures two workspaces:
|
||||
local wezterm = require 'wezterm'
|
||||
local mux = wezterm.mux
|
||||
|
||||
wezterm.on("gui-startup", function()
|
||||
wezterm.on('gui-startup', function()
|
||||
-- Set a workspace for coding on a current project
|
||||
-- Top pane is for the editor, bottom pane is for the build tool
|
||||
local project_dir = wezterm.home_dir .. "/wezterm"
|
||||
local tab, build_pane, window = mux.spawn_window{
|
||||
workspace="coding",
|
||||
cwd=project_dir,
|
||||
local project_dir = wezterm.home_dir .. '/wezterm'
|
||||
local tab, build_pane, window = mux.spawn_window {
|
||||
workspace = 'coding',
|
||||
cwd = project_dir,
|
||||
}
|
||||
local editor_pane = build_pane:split{
|
||||
direction="Top",
|
||||
size=0.6,
|
||||
cwd=project_dir
|
||||
local editor_pane = build_pane:split {
|
||||
direction = 'Top',
|
||||
size = 0.6,
|
||||
cwd = project_dir,
|
||||
}
|
||||
-- may as well kick off a build in that pane
|
||||
build_pane:send_text("cargo build\n")
|
||||
build_pane:send_text 'cargo build\n'
|
||||
|
||||
-- A workspace for interacting with a local machine that
|
||||
-- runs some docker containners for home automation
|
||||
local tab, pane, window = mux.spawn_window{
|
||||
workspace="automation",
|
||||
args={"ssh", "vault"},
|
||||
local tab, pane, window = mux.spawn_window {
|
||||
workspace = 'automation',
|
||||
args = { 'ssh', 'vault' },
|
||||
}
|
||||
|
||||
-- We want to startup in the coding workspace
|
||||
mux.set_active_workspace("coding")
|
||||
mux.set_active_workspace 'coding'
|
||||
end)
|
||||
|
||||
return {}
|
||||
|
@ -7,8 +7,8 @@ Activates copy mode!
|
||||
```lua
|
||||
return {
|
||||
keys = {
|
||||
{key="X", mods="CTRL", action=wezterm.action.ActivateCopyMode},
|
||||
}
|
||||
{ key = 'X', mods = 'CTRL', action = wezterm.action.ActivateCopyMode },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -6,11 +6,15 @@ Activate the last active tab. If there is none, it will do nothing.
|
||||
|
||||
```lua
|
||||
return {
|
||||
leader = { key="a", mods="CTRL" },
|
||||
leader = { key = 'a', mods = 'CTRL' },
|
||||
keys = {
|
||||
-- CTRL-a, followed by CTRL-o will switch back to the last active tab
|
||||
{key="o", mods="LEADER|CTRL", action=wezterm.action.ActivateLastTab},
|
||||
}
|
||||
{
|
||||
key = 'o',
|
||||
mods = 'LEADER|CTRL',
|
||||
action = wezterm.action.ActivateLastTab,
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -14,9 +14,9 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="a", mods="ALT", action=act.ActivatePaneByIndex(0)},
|
||||
{key="b", mods="ALT", action=act.ActivatePaneByIndex(1)},
|
||||
{key="c", mods="ALT", action=act.ActivatePaneByIndex(2)},
|
||||
}
|
||||
{ key = 'a', mods = 'ALT', action = act.ActivatePaneByIndex(0) },
|
||||
{ key = 'b', mods = 'ALT', action = act.ActivatePaneByIndex(1) },
|
||||
{ key = 'c', mods = 'ALT', action = act.ActivatePaneByIndex(2) },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -15,15 +15,27 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{ key = "LeftArrow", mods="CTRL|SHIFT",
|
||||
action=act.ActivatePaneDirection("Left")},
|
||||
{ key = "RightArrow", mods="CTRL|SHIFT",
|
||||
action=act.ActivatePaneDirection("Right")},
|
||||
{ key = "UpArrow", mods="CTRL|SHIFT",
|
||||
action=act.ActivatePaneDirection("Up")},
|
||||
{ key = "DownArrow", mods="CTRL|SHIFT",
|
||||
action=act.ActivatePaneDirection("Down")},
|
||||
}
|
||||
{
|
||||
key = 'LeftArrow',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ActivatePaneDirection 'Left',
|
||||
},
|
||||
{
|
||||
key = 'RightArrow',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ActivatePaneDirection 'Right',
|
||||
},
|
||||
{
|
||||
key = 'UpArrow',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ActivatePaneDirection 'Up',
|
||||
},
|
||||
{
|
||||
key = 'DownArrow',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ActivatePaneDirection 'Down',
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -18,14 +18,14 @@ local mykeys = {}
|
||||
for i = 1, 8 do
|
||||
-- CTRL+ALT + number to activate that tab
|
||||
table.insert(mykeys, {
|
||||
key=tostring(i),
|
||||
mods="CTRL|ALT",
|
||||
action=act.ActivateTab(i-1),
|
||||
key = tostring(i),
|
||||
mods = 'CTRL|ALT',
|
||||
action = act.ActivateTab(i - 1),
|
||||
})
|
||||
-- F1 through F8 to activate that tab
|
||||
table.insert(mykeys, {
|
||||
key="F" .. tostring(i),
|
||||
action=act.ActivateTab(i-1),
|
||||
key = 'F' .. tostring(i),
|
||||
action = act.ActivateTab(i - 1),
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -10,9 +10,9 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="{", mods="ALT", action=act.ActivateTabRelative(-1)},
|
||||
{key="}", mods="ALT", action=act.ActivateTabRelative(1)},
|
||||
}
|
||||
{ key = '{', mods = 'ALT', action = act.ActivateTabRelative(-1) },
|
||||
{ key = '}', mods = 'ALT', action = act.ActivateTabRelative(1) },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -17,9 +17,9 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="{", mods="ALT", action=act.ActivateTabRelativeNoWrap(-1)},
|
||||
{key="}", mods="ALT", action=act.ActivateTabRelativeNoWrap(1)},
|
||||
}
|
||||
{ key = '{', mods = 'ALT', action = act.ActivateTabRelativeNoWrap(-1) },
|
||||
{ key = '}', mods = 'ALT', action = act.ActivateTabRelativeNoWrap(1) },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -21,12 +21,24 @@ local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
return {
|
||||
leader = { key="a", mods="CTRL" },
|
||||
leader = { key = 'a', mods = 'CTRL' },
|
||||
keys = {
|
||||
{ key = "H", mods = "LEADER", action=act.AdjustPaneSize{"Left", 5} },
|
||||
{ key = "J", mods = "LEADER", action=act.AdjustPaneSize{"Down", 5} },
|
||||
{ key = "K", mods = "LEADER", action=act.AdjustPaneSize{"Up", 5} },
|
||||
{ key = "L", mods = "LEADER", action=act.AdjustPaneSize{"Right", 5} },
|
||||
}
|
||||
{
|
||||
key = 'H',
|
||||
mods = 'LEADER',
|
||||
action = act.AdjustPaneSize { 'Left', 5 },
|
||||
},
|
||||
{
|
||||
key = 'J',
|
||||
mods = 'LEADER',
|
||||
action = act.AdjustPaneSize { 'Down', 5 },
|
||||
},
|
||||
{ key = 'K', mods = 'LEADER', action = act.AdjustPaneSize { 'Up', 5 } },
|
||||
{
|
||||
key = 'L',
|
||||
mods = 'LEADER',
|
||||
action = act.AdjustPaneSize { 'Right', 5 },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -24,12 +24,16 @@ local wezterm = require 'wezterm'
|
||||
return {
|
||||
ssh_domains = {
|
||||
{
|
||||
name = "devhost",
|
||||
remote_address = "devhost.example.com",
|
||||
}
|
||||
name = 'devhost',
|
||||
remote_address = 'devhost.example.com',
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{key="U", mods="CTRL|SHIFT", action=wezterm.action.AttachDomain("devhost")},
|
||||
{
|
||||
key = 'U',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.AttachDomain 'devhost',
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -15,9 +15,17 @@ return {
|
||||
keys = {
|
||||
-- Clears only the scrollback and leaves the viewport intact.
|
||||
-- This is the default behavior.
|
||||
{key="K", mods="CTRL|SHIFT", action=act.ClearScrollback("ScrollbackOnly")},
|
||||
{
|
||||
key = 'K',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ClearScrollback 'ScrollbackOnly',
|
||||
},
|
||||
-- Clears the scrollback and viewport leaving the prompt line the new first line.
|
||||
{key="K", mods="CTRL|SHIFT", action=act.ClearScrollback("ScrollbackAndViewport")},
|
||||
}
|
||||
{
|
||||
key = 'K',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ClearScrollback 'ScrollbackAndViewport',
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -15,25 +15,25 @@ local act = wezterm.action
|
||||
return {
|
||||
keys = {
|
||||
{
|
||||
key="c",
|
||||
mods="CTRL",
|
||||
key = 'c',
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action_callback(function(window, pane)
|
||||
local has_selection = window:get_selection_text_for_pane(pane) ~= ""
|
||||
local has_selection = window:get_selection_text_for_pane(pane) ~= ''
|
||||
if has_selection then
|
||||
window:perform_action(
|
||||
act.CopyTo("ClipboardAndPrimarySelection"),
|
||||
act.CopyTo 'ClipboardAndPrimarySelection',
|
||||
pane
|
||||
)
|
||||
|
||||
window:perform_action(act.ClearSelection, pane)
|
||||
else
|
||||
window:perform_action(
|
||||
act.SendKey{key="c", mods="CTRL"},
|
||||
act.SendKey { key = 'c', mods = 'CTRL' },
|
||||
pane
|
||||
)
|
||||
end
|
||||
end)
|
||||
}
|
||||
}
|
||||
end),
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -12,8 +12,12 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="w", mods="CMD", action=wezterm.action.CloseCurrentPane{confirm=true}},
|
||||
}
|
||||
{
|
||||
key = 'w',
|
||||
mods = 'CMD',
|
||||
action = wezterm.action.CloseCurrentPane { confirm = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -6,8 +6,12 @@ tab, closes that window. If that was the last window, wezterm terminates.
|
||||
```lua
|
||||
return {
|
||||
keys = {
|
||||
{key="w", mods="CMD", action=wezterm.action.CloseCurrentTab{confirm=true}},
|
||||
}
|
||||
{
|
||||
key = 'w',
|
||||
mods = 'CMD',
|
||||
action = wezterm.action.CloseCurrentTab { confirm = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -11,7 +11,7 @@ which clipboard buffer the selection will populate; the copy action
|
||||
is now equivalent to [CopyTo](CopyTo.md).
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
mouse_bindings = {
|
||||
@ -20,11 +20,10 @@ return {
|
||||
-- the Clipboard rather the PrimarySelection which is part
|
||||
-- of the default assignment for a left mouse click.
|
||||
{
|
||||
event={Up={streak=1, button="Left"}},
|
||||
mods="NONE",
|
||||
action=wezterm.action.CompleteSelection("Clipboard"),
|
||||
event = { Up = { streak = 1, button = 'Left' } },
|
||||
mods = 'NONE',
|
||||
action = wezterm.action.CompleteSelection 'Clipboard',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
```
|
||||
|
@ -12,18 +12,17 @@ which clipboard buffer the selection will populate. The copy action
|
||||
is now equivalent to [CopyTo](CopyTo.md).
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
mouse_bindings = {
|
||||
-- Change the default click behavior so that it populates
|
||||
-- the Clipboard rather the PrimarySelection.
|
||||
{
|
||||
event={Up={streak=1, button="Left"}},
|
||||
mods="NONE",
|
||||
action=wezterm.action.CompleteSelectionOrOpenLinkAtMouseCursor("Clipboard"),
|
||||
event = { Up = { streak = 1, button = 'Left' } },
|
||||
mods = 'NONE',
|
||||
action = wezterm.action.CompleteSelectionOrOpenLinkAtMouseCursor 'Clipboard',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
```
|
||||
|
@ -14,8 +14,8 @@ a future release; please use [CopyTo](CopyTo.md) instead.
|
||||
local wezterm = require 'wezterm'
|
||||
return {
|
||||
keys = {
|
||||
{key="C", mods="CTRL", action=wezterm.action.Copy},
|
||||
}
|
||||
{ key = 'C', mods = 'CTRL', action = wezterm.action.Copy },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -13,8 +13,12 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="C", mods="CTRL", action=wezterm.action.CopyTo("ClipboardAndPrimarySelection")},
|
||||
}
|
||||
{
|
||||
key = 'C',
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action.CopyTo 'ClipboardAndPrimarySelection',
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -7,8 +7,8 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="-", mods="CTRL", action=wezterm.action.DecreaseFontSize},
|
||||
}
|
||||
{ key = '-', mods = 'CTRL', action = wezterm.action.DecreaseFontSize },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -17,19 +17,26 @@ local act = wezterm.action
|
||||
return {
|
||||
ssh_domains = {
|
||||
{
|
||||
name = "devhost",
|
||||
remote_address = "devhost.example.com",
|
||||
}
|
||||
name = 'devhost',
|
||||
remote_address = 'devhost.example.com',
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{key="U", mods="CTRL|SHIFT", action=act.AttachDomain("devhost")},
|
||||
{ key = 'U', mods = 'CTRL|SHIFT', action = act.AttachDomain 'devhost' },
|
||||
-- Detaches the domain associated with the current pane
|
||||
{key="D", mods="CTRL|SHIFT", action=act.DetachDomain("CurrentPaneDomain")},
|
||||
{
|
||||
key = 'D',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.DetachDomain 'CurrentPaneDomain',
|
||||
},
|
||||
-- Detaches the "devhost" domain
|
||||
{key="E", mods="CTRL|SHIFT", action=act.DetachDomain{DomainName="devhost"}},
|
||||
{
|
||||
key = 'E',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.DetachDomain { DomainName = 'devhost' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
See also: [AttachDomain](AttachDomain.md)
|
||||
|
@ -12,8 +12,12 @@ return {
|
||||
keys = {
|
||||
-- Turn off the default CMD-m Hide action, allowing CMD-m to
|
||||
-- be potentially recognized and handled by the tab
|
||||
{key="m", mods="CMD", action=wezterm.action.DisableDefaultAssignment},
|
||||
}
|
||||
{
|
||||
key = 'm',
|
||||
mods = 'CMD',
|
||||
action = wezterm.action.DisableDefaultAssignment,
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -9,16 +9,16 @@ the scope of the selection.
|
||||
The mode argument can also be `"Block"` to enable a rectangular block selection.
|
||||
|
||||
```lua
|
||||
local wezterm = require "wezterm"
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
mouse_bindings = {
|
||||
{
|
||||
event={Up={streak=1, button="Left"}},
|
||||
mods="SHIFT",
|
||||
action=wezterm.action.ExtendSelectionToMouseCursor("Word"),
|
||||
event = { Up = { streak = 1, button = 'Left' } },
|
||||
mods = 'SHIFT',
|
||||
action = wezterm.action.ExtendSelectionToMouseCursor 'Word',
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -7,7 +7,7 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="h", mods="CMD", action=wezterm.action.Hide},
|
||||
}
|
||||
{ key = 'h', mods = 'CMD', action = wezterm.action.Hide },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -7,7 +7,7 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="h", mods="CMD", action=wezterm.action.HideApplication},
|
||||
}
|
||||
{ key = 'h', mods = 'CMD', action = wezterm.action.HideApplication },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -7,7 +7,7 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="=", mods="CTRL", action=wezterm.action.IncreaseFontSize},
|
||||
}
|
||||
{ key = '=', mods = 'CTRL', action = wezterm.action.IncreaseFontSize },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -11,9 +11,9 @@ local mykeys = {}
|
||||
for i = 1, 8 do
|
||||
-- CTRL+ALT + number to move to that position
|
||||
table.insert(mykeys, {
|
||||
key=tostring(i),
|
||||
mods="CTRL|ALT",
|
||||
action=wezterm.action.MoveTab(i - 1),
|
||||
key = tostring(i),
|
||||
mods = 'CTRL|ALT',
|
||||
action = wezterm.action.MoveTab(i - 1),
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -10,9 +10,9 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="{", mods="SHIFT|ALT", action=act.MoveTabRelative(-1)},
|
||||
{key="}", mods="SHIFT|ALT", action=act.MoveTabRelative(1)},
|
||||
}
|
||||
{ key = '{', mods = 'SHIFT|ALT', action = act.MoveTabRelative(-1) },
|
||||
{ key = '}', mods = 'SHIFT|ALT', action = act.MoveTabRelative(1) },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -13,12 +13,15 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="LeftArrow", action=act.Multiple{
|
||||
act.SendKey{key="l"},
|
||||
act.SendKey{key="e"},
|
||||
act.SendKey{key="f"},
|
||||
act.SendKey{key="t"}
|
||||
}}
|
||||
}
|
||||
{
|
||||
key = 'LeftArrow',
|
||||
action = act.Multiple {
|
||||
act.SendKey { key = 'l' },
|
||||
act.SendKey { key = 'e' },
|
||||
act.SendKey { key = 'f' },
|
||||
act.SendKey { key = 't' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -12,8 +12,8 @@ local wezterm = require 'wezterm'
|
||||
return {
|
||||
keys = {
|
||||
-- Turn off any side effects from pressing CMD-m
|
||||
{key="m", mods="CMD", action=wezterm.action.Nop},
|
||||
}
|
||||
{ key = 'm', mods = 'CMD', action = wezterm.action.Nop },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -10,9 +10,9 @@ return {
|
||||
mouse_bindings = {
|
||||
-- Ctrl-click will open the link under the mouse cursor
|
||||
{
|
||||
event={Up={streak=1, button="Left"}},
|
||||
mods="CTRL",
|
||||
action=wezterm.action.OpenLinkAtMouseCursor,
|
||||
event = { Up = { streak = 1, button = 'Left' } },
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action.OpenLinkAtMouseCursor,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -29,12 +29,24 @@ return {
|
||||
|
||||
keys = {
|
||||
-- activate pane selection mode with the default alphabet (labels are "a", "s", "d", "f" and so on)
|
||||
{key="8", mods="CTRL", action=act.PaneSelect},
|
||||
{ key = '8', mods = 'CTRL', action = act.PaneSelect },
|
||||
-- activate pane selection mode with numeric labels
|
||||
{key="9", mods="CTRL", action=act.PaneSelect{alphabet="1234567890"}},
|
||||
{
|
||||
key = '9',
|
||||
mods = 'CTRL',
|
||||
action = act.PaneSelect {
|
||||
alphabet = '1234567890',
|
||||
},
|
||||
},
|
||||
-- show the pane selection mode, but have it swap the active and selected panes
|
||||
{key="0", mods="CTRL", action=act.PaneSelect{mode="SwapWithActive"}},
|
||||
}
|
||||
{
|
||||
key = '0',
|
||||
mods = 'CTRL',
|
||||
action = act.PaneSelect {
|
||||
mode = 'SwapWithActive',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -14,18 +14,18 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="v", mods="SHIFT|CTRL", action=wezterm.action.Paste},
|
||||
{ key = 'v', mods = 'SHIFT|CTRL', action = wezterm.action.Paste },
|
||||
},
|
||||
|
||||
-- Middle mouse button pastes the clipboard.
|
||||
-- Note that this is the default so you needn't copy this.
|
||||
mouse_bindings = {
|
||||
{
|
||||
event={Up={streak=1, button="Middle"}},
|
||||
mods="NONE",
|
||||
action=wezterm.action.Paste,
|
||||
event = { Up = { streak = 1, button = 'Middle' } },
|
||||
mods = 'NONE',
|
||||
action = wezterm.action.Paste,
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -18,10 +18,10 @@ local act = wezterm.action
|
||||
return {
|
||||
keys = {
|
||||
-- paste from the clipboard
|
||||
{key="V", mods="CTRL", action=act.PasteFrom("Clipboard")},
|
||||
{ key = 'V', mods = 'CTRL', action = act.PasteFrom 'Clipboard' },
|
||||
|
||||
-- paste from the primary selection
|
||||
{key="V", mods="CTRL", action=act.PasteFrom("PrimarySelection")},
|
||||
{ key = 'V', mods = 'CTRL', action = act.PasteFrom 'PrimarySelection' },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -16,17 +16,17 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="v", mods="SHIFT|CTRL", action=act.PastePrimarySelection},
|
||||
{ key = 'v', mods = 'SHIFT|CTRL', action = act.PastePrimarySelection },
|
||||
},
|
||||
|
||||
-- Middle mouse button pastes the primary selection.
|
||||
mouse_bindings = {
|
||||
{
|
||||
event={Up={streak=1, button="Middle"}},
|
||||
mods="NONE",
|
||||
action=act.PastePrimarySelection,
|
||||
event = { Up = { streak = 1, button = 'Middle' } },
|
||||
mods = 'NONE',
|
||||
action = act.PastePrimarySelection,
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -9,8 +9,8 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key=" ", mods="SHIFT|CTRL", action=wezterm.action.QuickSelect},
|
||||
}
|
||||
{ key = ' ', mods = 'SHIFT|CTRL', action = wezterm.action.QuickSelect },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -15,13 +15,15 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="P", mods="CTRL",
|
||||
action=wezterm.action.QuickSelectArgs{
|
||||
patterns={
|
||||
"https?://\\S+"
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
key = 'P',
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action.QuickSelectArgs {
|
||||
patterns = {
|
||||
'https?://\\S+',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
@ -42,19 +44,21 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="P", mods="CTRL",
|
||||
action=wezterm.action.QuickSelectArgs{
|
||||
label = "open url",
|
||||
patterns={
|
||||
"https?://\\S+"
|
||||
},
|
||||
action = wezterm.action_callback(function(window, pane)
|
||||
{
|
||||
key = 'P',
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action.QuickSelectArgs {
|
||||
label = 'open url',
|
||||
patterns = {
|
||||
'https?://\\S+',
|
||||
},
|
||||
action = wezterm.action_callback(function(window, pane)
|
||||
local url = window:get_selection_text_for_pane(pane)
|
||||
wezterm.log_info("opening: " .. url)
|
||||
wezterm.log_info('opening: ' .. url)
|
||||
wezterm.open_with(url)
|
||||
end)
|
||||
}
|
||||
},
|
||||
end),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -7,8 +7,8 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="q", mods="CMD", action=wezterm.action.QuitApplication},
|
||||
}
|
||||
{ key = 'q', mods = 'CMD', action = wezterm.action.QuitApplication },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -7,8 +7,12 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="r", mods="CMD|SHIFT", action=wezterm.action.ReloadConfiguration},
|
||||
}
|
||||
{
|
||||
key = 'r',
|
||||
mods = 'CMD|SHIFT',
|
||||
action = wezterm.action.ReloadConfiguration,
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -10,8 +10,12 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="0", mods="CTRL", action=wezterm.action.ResetFontAndWindowSize},
|
||||
}
|
||||
{
|
||||
key = '0',
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action.ResetFontAndWindowSize,
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -7,8 +7,8 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="0", mods="CTRL", action=wezterm.action.ResetFontSize},
|
||||
}
|
||||
{ key = '0', mods = 'CTRL', action = wezterm.action.ResetFontSize },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -43,8 +43,12 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="b", mods="CTRL", action=act.RotatePanes("CounterClockwise")},
|
||||
{key="n", mods="CTRL", action=act.RotatePanes("Clockwise")},
|
||||
{
|
||||
key = 'b',
|
||||
mods = 'CTRL',
|
||||
action = act.RotatePanes 'CounterClockwise',
|
||||
},
|
||||
{ key = 'n', mods = 'CTRL', action = act.RotatePanes 'Clockwise' },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -6,14 +6,14 @@ Adjusts the scroll position by the number of lines specified by the argument.
|
||||
Negative values scroll upwards, while positive values scroll downwards.
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="UpArrow", mods="SHIFT", action=act.ScrollByLine(-1)},
|
||||
{key="DownArrow", mods="SHIFT", action=act.ScrollByLine(1)},
|
||||
}
|
||||
{ key = 'UpArrow', mods = 'SHIFT', action = act.ScrollByLine(-1) },
|
||||
{ key = 'DownArrow', mods = 'SHIFT', action = act.ScrollByLine(1) },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -9,9 +9,9 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="PageUp", mods="SHIFT", action=act.ScrollByPage(-1)},
|
||||
{key="PageDown", mods="SHIFT", action=act.ScrollByPage(1)},
|
||||
}
|
||||
{ key = 'PageUp', mods = 'SHIFT', action = act.ScrollByPage(-1) },
|
||||
{ key = 'PageDown', mods = 'SHIFT', action = act.ScrollByPage(1) },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -21,12 +21,12 @@ You may now use floating point values to scroll by partial pages. This example
|
||||
how to make the `PageUp`/`PageDown` scroll by half a page at a time:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="PageUp", mods="SHIFT", action=act.ScrollByPage(-0.5)},
|
||||
{key="PageDown", mods="SHIFT", action=act.ScrollByPage(0.5)},
|
||||
}
|
||||
{ key = 'PageUp', mods = 'SHIFT', action = act.ScrollByPage(-0.5) },
|
||||
{ key = 'PageDown', mods = 'SHIFT', action = act.ScrollByPage(0.5) },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -26,9 +26,9 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="UpArrow", mods="SHIFT", action=act.ScrollToPrompt(-1)},
|
||||
{key="DownArrow", mods="SHIFT", action=act.ScrollToPrompt(1)},
|
||||
}
|
||||
{ key = 'UpArrow', mods = 'SHIFT', action = act.ScrollToPrompt(-1) },
|
||||
{ key = 'DownArrow', mods = 'SHIFT', action = act.ScrollToPrompt(1) },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -18,11 +18,25 @@ local act = wezterm.action
|
||||
return {
|
||||
keys = {
|
||||
-- search for things that look like git hashes
|
||||
{key="H", mods="SHIFT|CTRL", action=act.Search{Regex="[a-f0-9]{6,}"}},
|
||||
{
|
||||
key = 'H',
|
||||
mods = 'SHIFT|CTRL',
|
||||
action = act.Search {
|
||||
Regex = '[a-f0-9]{6,}',
|
||||
},
|
||||
},
|
||||
-- search for the lowercase string "hash" matching the case exactly
|
||||
{key="H", mods="SHIFT|CTRL", action=act.Search{CaseSensitiveString="hash"}},
|
||||
{
|
||||
key = 'H',
|
||||
mods = 'SHIFT|CTRL',
|
||||
action = act.Search { CaseSensitiveString = 'hash' },
|
||||
},
|
||||
-- search for the string "hash" matching regardless of case
|
||||
{key="H", mods="SHIFT|CTRL", action=act.Search{CaseInSensitiveString="hash"}},
|
||||
{
|
||||
key = 'H',
|
||||
mods = 'SHIFT|CTRL',
|
||||
action = act.Search { CaseInSensitiveString = 'hash' },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -18,9 +18,10 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
mouse_bindings = {
|
||||
{ event={Down={streak=3, button="Left"}},
|
||||
action=wezterm.action.SelectTextAtMouseCursor("SemanticZone"),
|
||||
mods="NONE"
|
||||
{
|
||||
event = { Down = { streak = 3, button = 'Left' } },
|
||||
action = wezterm.action.SelectTextAtMouseCursor 'SemanticZone',
|
||||
mods = 'NONE',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -23,10 +23,21 @@ local act = wezterm.action
|
||||
|
||||
return {
|
||||
keys = {
|
||||
-- Rebind OPT-Left, OPT-Right as ALT-b, ALT-f respectively to match Terminal.app behavior
|
||||
{key="LeftArrow", mods="OPT", action=act.SendKey{key="b", mods="ALT"}},
|
||||
{key="RightArrow", mods="OPT", action=act.SendKey{key="f", mods="ALT"}},
|
||||
}
|
||||
-- Rebind OPT-Left, OPT-Right as ALT-b, ALT-f respectively to match Terminal.app behavior
|
||||
{
|
||||
key = 'LeftArrow',
|
||||
mods = 'OPT',
|
||||
action = act.SendKey {
|
||||
key = 'b',
|
||||
mods = 'ALT',
|
||||
},
|
||||
},
|
||||
{
|
||||
key = 'RightArrow',
|
||||
mods = 'OPT',
|
||||
action = act.SendKey { key = 'f', mods = 'ALT' },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -8,8 +8,8 @@ local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="m", mods="CMD", action=wezterm.action.SendString("Hello")},
|
||||
}
|
||||
{ key = 'm', mods = 'CMD', action = wezterm.action.SendString 'Hello' },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -26,10 +26,10 @@ local act = wezterm.action
|
||||
return {
|
||||
keys = {
|
||||
-- Make Option-Left equivalent to Alt-b which many line editors interpret as backward-word
|
||||
{key="LeftArrow", mods="OPT", action=act.SendString("\x1bb")},
|
||||
{ key = 'LeftArrow', mods = 'OPT', action = act.SendString '\x1bb' },
|
||||
-- Make Option-Right equivalent to Alt-f; forward-word
|
||||
{key="RightArrow", mods="OPT", action=act.SendString("\x1bf")},
|
||||
}
|
||||
{ key = 'RightArrow', mods = 'OPT', action = act.SendString '\x1bf' },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user