Update wezterm config
This commit is contained in:
parent
238f3ea099
commit
12e47a8613
44 changed files with 10874 additions and 171 deletions
|
@ -1,11 +1,11 @@
|
||||||
local wezterm = require("wezterm")
|
local wezterm = require("wezterm") --[[@as Wezterm]]
|
||||||
|
|
||||||
local config = {}
|
local config = {}
|
||||||
|
|
||||||
-- color scheme
|
-- color scheme
|
||||||
config.color_scheme = "Everforest Dark Soft (Gogh)"
|
config.color_scheme = "Everforest Dark Soft (Gogh)"
|
||||||
-- font
|
-- font
|
||||||
config.font = wezterm.font("Fantasque Sans Mono")
|
config.font = wezterm.font("Hack")
|
||||||
config.font_size = 14.0
|
config.font_size = 14.0
|
||||||
-- Ligatures in terminal/programming fonts IMO are a bad idea,
|
-- Ligatures in terminal/programming fonts IMO are a bad idea,
|
||||||
-- as they require the user to mentally translate what the ligature represents,
|
-- as they require the user to mentally translate what the ligature represents,
|
||||||
|
@ -31,4 +31,7 @@ config.inactive_pane_hsb = {
|
||||||
-- scrollbar
|
-- scrollbar
|
||||||
config.enable_scroll_bar = true
|
config.enable_scroll_bar = true
|
||||||
|
|
||||||
|
-- cursor
|
||||||
|
config.default_cursor_style = 'SteadyBar'
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
local wezterm = require("wezterm")
|
local wezterm = require("wezterm") --[[@as Wezterm]]
|
||||||
|
local util = require("util")
|
||||||
local act = wezterm.action
|
local act = wezterm.action
|
||||||
|
|
||||||
|
-- We override the key bindings here, so as to explicitly define what they are rather than relying on default values.
|
||||||
local keys = {
|
local keys = {
|
||||||
-- Tab Management
|
-- Tab Management
|
||||||
{ key = "T", mods = "SHIFT|CTRL", action = act.SpawnTab "CurrentPaneDomain" },
|
{ key = "T", mods = "SHIFT|CTRL", action = act.SpawnTab "CurrentPaneDomain" },
|
||||||
|
@ -50,6 +52,8 @@ local keys = {
|
||||||
{ key = "Insert", mods = "CTRL", action = act.CopyTo "PrimarySelection" },
|
{ key = "Insert", mods = "CTRL", action = act.CopyTo "PrimarySelection" },
|
||||||
{ key = "Copy", mods = "NONE", action = act.CopyTo "Clipboard" },
|
{ key = "Copy", mods = "NONE", action = act.CopyTo "Clipboard" },
|
||||||
{ key = "Paste", mods = "NONE", action = act.PasteFrom "Clipboard" },
|
{ key = "Paste", mods = "NONE", action = act.PasteFrom "Clipboard" },
|
||||||
|
-- Other
|
||||||
|
{ key = "G", mods = "SHIFT|CTRL", action = wezterm.action_callback(util.open_last_output_in_less) },
|
||||||
}
|
}
|
||||||
|
|
||||||
local key_tables = {
|
local key_tables = {
|
||||||
|
@ -119,9 +123,56 @@ local key_tables = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- We also override the default mouse bindings, and the reasons are as follows:
|
||||||
|
-- 1) The default bindings often clobber the system clipboard, which I don't want, and
|
||||||
|
-- 2) Some of the default bindings are frivolous and unnecessary
|
||||||
|
local mouse_bindings = {
|
||||||
|
-- Left mouse button click
|
||||||
|
{
|
||||||
|
event = { Down = { streak = 1, button = "Left" } },
|
||||||
|
action = act.SelectTextAtMouseCursor("Cell"),
|
||||||
|
mods = "NONE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
event = { Up = { streak = 1, button = "Left" } },
|
||||||
|
action = act.CompleteSelectionOrOpenLinkAtMouseCursor("PrimarySelection"),
|
||||||
|
mods = "NONE"
|
||||||
|
},
|
||||||
|
-- Middle mouse button click
|
||||||
|
{
|
||||||
|
event = { Down = { streak = 1, button = "Middle" } },
|
||||||
|
action = act.PasteFrom("PrimarySelection"),
|
||||||
|
mods = "NONE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
event = { Down = { streak = 1, button = "Middle" } },
|
||||||
|
action = act.PasteFrom("Clipboard"),
|
||||||
|
mods = "ALT"
|
||||||
|
},
|
||||||
|
-- Right mouse button click
|
||||||
|
{
|
||||||
|
event = { Down = { streak = 1, button = "Right" } },
|
||||||
|
action = act.SelectTextAtMouseCursor("SemanticZone"),
|
||||||
|
mods = "CTRL|SHIFT"
|
||||||
|
},
|
||||||
|
-- Left mouse button drag
|
||||||
|
{
|
||||||
|
event = { Drag = { streak = 1, button = "Left" } },
|
||||||
|
action = act.ExtendSelectionToMouseCursor("Cell"),
|
||||||
|
mods = "NONE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
event = { Drag = { streak = 1, button = "Left" } },
|
||||||
|
action = act.StartWindowDrag,
|
||||||
|
mods = "SUPER"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
local config = {}
|
local config = {}
|
||||||
config.keys = keys
|
config.keys = keys
|
||||||
config.disable_default_key_bindings = true
|
config.disable_default_key_bindings = true
|
||||||
|
config.disable_default_mouse_bindings = true
|
||||||
config.key_tables = key_tables
|
config.key_tables = key_tables
|
||||||
|
config.mouse_bindings = mouse_bindings
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
|
@ -7,5 +7,6 @@ config.exit_behavior = 'Close'
|
||||||
config.exit_behavior_messaging = 'Verbose'
|
config.exit_behavior_messaging = 'Verbose'
|
||||||
config.status_update_interval = 25
|
config.status_update_interval = 25
|
||||||
config.default_prog = { '/usr/local/bin/hilbish', '-l' }
|
config.default_prog = { '/usr/local/bin/hilbish', '-l' }
|
||||||
|
config.switch_to_last_active_tab_when_closing_tab = true
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local wezterm = require("wezterm")
|
local wezterm = require("wezterm") --[[@as Wezterm]]
|
||||||
local util = require("util")
|
local util = require("util")
|
||||||
|
|
||||||
local scheme = util.get_schemes()["Everforest Dark Soft (Gogh)"]
|
local scheme = util.get_schemes()["Everforest Dark Soft (Gogh)"]
|
||||||
|
@ -46,11 +46,17 @@ wezterm.on("update-status", function(window, pane)
|
||||||
end
|
end
|
||||||
|
|
||||||
table.insert(right_status, "ResetAttributes")
|
table.insert(right_status, "ResetAttributes")
|
||||||
|
if cwd_path ~= "" then
|
||||||
table.insert(right_status, { Background = { Color = scheme.ansi[8] } })
|
table.insert(right_status, { Background = { Color = scheme.ansi[8] } })
|
||||||
table.insert(right_status, { Foreground = { Color = scheme.ansi[1] } })
|
table.insert(right_status, { Foreground = { Color = scheme.ansi[1] } })
|
||||||
table.insert(right_status, { Attribute = { Intensity = "Bold" } })
|
table.insert(right_status, { Attribute = { Intensity = "Bold" } })
|
||||||
table.insert(right_status, { Text = cwd_path })
|
table.insert(right_status, { Text = cwd_path .. " " })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- domain name
|
||||||
|
table.insert(right_status, { Background = { Color = scheme.brights[1] } })
|
||||||
|
table.insert(right_status, { Foreground = { Color = scheme.ansi[8] } })
|
||||||
|
table.insert(right_status, { Text = " " .. pane:get_domain_name() .. " " })
|
||||||
|
|
||||||
window:set_right_status(wezterm.format(right_status))
|
window:set_right_status(wezterm.format(right_status))
|
||||||
end)
|
end)
|
||||||
|
|
5
.config/wezterm/types/config/audible-bell.lua
Executable file
5
.config/wezterm/types/config/audible-bell.lua
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@alias AudibleBell
|
||||||
|
---| "SystemBeep" Perform the system beep or alert sound. This is the default. On Wayland systems, which have no system beep function, it does not produce a sound.
|
||||||
|
---| "Disabled" Don't make a sound
|
31
.config/wezterm/types/config/background.lua
Executable file
31
.config/wezterm/types/config/background.lua
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@alias HexColor string A color in the form "#RRGGBB" or "#RRGGBBAA" where the AA component is optional and defaults to "FF" if not specified.
|
||||||
|
|
||||||
|
---@class FileSource
|
||||||
|
---@field File string Load the specified image file. PNG, JPEG, GIF, BMP, ICO, TIFF, PNM, DDS, TGA and farbfeld files can be loaded. Animated GIF and PNG files will animate while the window has focus.
|
||||||
|
|
||||||
|
---@class FileSourceWithPath
|
||||||
|
---@field File {path: string, speed: number} Load the specified image file, which is an animated gif, and adjust the animation speed to x times its normal speed.
|
||||||
|
|
||||||
|
---@class GradientSource
|
||||||
|
---@field Gradient Gradient Generate a gradient
|
||||||
|
|
||||||
|
---@class ColorSource
|
||||||
|
---@field Color {Color: AnsiColor | HexColor} Generate an image with the specified color.
|
||||||
|
|
||||||
|
---@class BackgroundLayer
|
||||||
|
---@field source FileSource | FileSourceWithPath | GradientSource | ColorSource Defines the source of the layer texture data.
|
||||||
|
---@field attachment "Fixed" | "Scroll" | {Parallax: number} Controls whether the layer is fixed to the viewport or moves as it scrolls.
|
||||||
|
---@field repeat_x "Repeat" | "Mirror" | "NoRepeat" Controls whether the image is repeated in the x-direction.
|
||||||
|
---@field repeat_y "Repeat" | "Mirror" | "NoRepeat" Controls whether the image is repeated in the y-direction.
|
||||||
|
---@field repeat_x_size number | string Normally, when repeating, the image is tiled based on its width such that each copy of the image is immediately adjacent to the preceding instance. You may set `repeat_x_size` to a different value to increase or decrease the space between the repeated instances.
|
||||||
|
---@field repeat_y_size number | string Normally, when repeating, the image is tiled based on its width such that each copy of the image is immediately adjacent to the preceding instance. You may set `repeat_y_size` to a different value to increase or decrease the space between the repeated instances.
|
||||||
|
---@field vertical_align "Top" | "Middle" | "Bottom" Controls the initial vertical position of the layer, relative to the viewport.
|
||||||
|
---@field horizontal_align "Left" | "Center" | "Right" Controls the initial horizontal position of the layer, relative to the viewport.
|
||||||
|
---@field vertical_offset number | string Specify an offset from the initial vertical position.
|
||||||
|
---@field horizontal_offset number | string Specify an offset from the initial horizontal position.
|
||||||
|
---@field opacity number A number in the range `0` through `1.0` inclusive that is multiplied with the alpha channel of the source to adjust the opacity of the layer. The default is `1.0` to use the source alpha channel as-is. Using a smaller value makes the layer less opaque/more transparent.
|
||||||
|
---@field hsb HsbTransform A hue, saturation, brightness transformation that can be used to adjust those attributes of the layer.
|
||||||
|
---@field height "Cover" | "Contain" | number | string Controls the height of the image.
|
||||||
|
---@field width "Cover" | "Contain" | number | string Controls the width of the image.
|
6
.config/wezterm/types/config/daemon-options.lua
Executable file
6
.config/wezterm/types/config/daemon-options.lua
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class DaemonOptions
|
||||||
|
---@field pid_file string Specify the location of the pid and lock file. The default location is `$XDG_RUNTIME_DIR/wezterm/pid` on X11/Wayland systems, or `$HOME/.local/share/wezterm/pid`.
|
||||||
|
---@field stdout string Specifies where a log of the stdout stream from the daemon will be placed. The default is `$XDG_RUNTIME_DIR/wezterm/stdout` on X11/Wayland systems, or `$HOME/.local/share/wezterm/stdout`.
|
||||||
|
---@field stderr string Specifies where a log of the stderr stream from the daemon will be placed. The default is `$XDG_RUNTIME_DIR/wezterm/stderr` on X11/Wayland systems, or `$HOME/.local/share/wezterm/stderr`.
|
449
.config/wezterm/types/config/init.lua
Executable file
449
.config/wezterm/types/config/init.lua
Executable file
|
@ -0,0 +1,449 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class Config
|
||||||
|
---@field font FontAttributes The baseline font to use
|
||||||
|
---@field dpi_by_screen { [string]: f64 }
|
||||||
|
---@field colors Palette The color palette
|
||||||
|
---@field switch_to_last_active_tab_when_closing_tab bool
|
||||||
|
---@field window_frame WindowFrameConfig
|
||||||
|
---@field char_select_font_size f64
|
||||||
|
---@field char_select_fg_color RgbaColor
|
||||||
|
---@field char_select_bg_color RgbaColor
|
||||||
|
---@field command_palette_font_size f64
|
||||||
|
---@field command_palette_fg_color RgbaColor
|
||||||
|
---@field command_palette_bg_color RgbaColor
|
||||||
|
---@field pane_select_font_size f64
|
||||||
|
---@field pane_select_fg_color RgbaColor
|
||||||
|
---@field pane_select_bg_color RgbaColor
|
||||||
|
---@field tab_bar_style TabBarStyle
|
||||||
|
---@field resolved_palette Palette
|
||||||
|
---@field color_scheme String
|
||||||
|
-- -- Use a named color scheme rather than the palette specified
|
||||||
|
-- -- by the colors setting.
|
||||||
|
---@field color_schemes {[String]: Palette}
|
||||||
|
-- -- Named color schemes
|
||||||
|
---@field scrollback_lines usize
|
||||||
|
-- -- How many lines of scrollback you want to retain
|
||||||
|
---@field default_prog String[]
|
||||||
|
-- -- If no `prog` is specified on the command line, use this
|
||||||
|
-- -- instead of running the user's shell.
|
||||||
|
-- -- For example, to have `wezterm` always run `top` by default
|
||||||
|
-- -- you'd use this:
|
||||||
|
-- --
|
||||||
|
-- -- ```toml
|
||||||
|
-- -- ```
|
||||||
|
-- --
|
||||||
|
-- -- `default_prog` is implemented as an array where the 0th element
|
||||||
|
-- -- is the command to run and the rest of the elements are passed
|
||||||
|
-- -- as the positional arguments to that command.
|
||||||
|
---@field default_gui_startup_args String[]
|
||||||
|
---@field default_cwd PathBuf
|
||||||
|
-- -- Specifies the default current working directory if none is specified
|
||||||
|
-- -- through configuration or OSC 7 (see docs for `default_cwd` for more
|
||||||
|
-- -- info!)
|
||||||
|
---@field exit_behavior ExitBehavior
|
||||||
|
---@field exit_behavior_messaging ExitBehaviorMessaging
|
||||||
|
---@field clean_exit_codes u32[]
|
||||||
|
---@field detect_password_input bool
|
||||||
|
---@field set_environment_variables {[String]: String}
|
||||||
|
-- -- Specifies a map of environment variables that should be set
|
||||||
|
-- -- when spawning commands in the local domain.
|
||||||
|
-- -- This is not used when working with remote domains.
|
||||||
|
---@field initial_rows u16
|
||||||
|
-- -- Specifies the height of a new window, expressed in character cells.
|
||||||
|
---@field enable_kitty_graphics bool
|
||||||
|
---@field enable_kitty_keyboard bool
|
||||||
|
---@field enable_title_reporting bool
|
||||||
|
-- -- Whether the terminal should respond to requests to read the
|
||||||
|
-- -- title string.
|
||||||
|
-- -- Disabled by default for security concerns with shells that might
|
||||||
|
-- -- otherwise attempt to execute the response.
|
||||||
|
-- -- <https://marc.info/?l=bugtraq&m=104612710031920&w=2>
|
||||||
|
---@field initial_cols u16
|
||||||
|
-- -- Specifies the width of a new window, expressed in character cells
|
||||||
|
---@field hyperlink_rules HyperlinkRule[]
|
||||||
|
---@field term String
|
||||||
|
-- -- What to set the TERM variable to
|
||||||
|
---@field font_locator FontLocatorSelection
|
||||||
|
---@field font_rasterizer FontRasterizerSelection
|
||||||
|
---@field font_shaper FontShaperSelection
|
||||||
|
---@field display_pixel_geometry DisplayPixelGeometry
|
||||||
|
---@field freetype_load_target FreeTypeLoadTarget
|
||||||
|
---@field freetype_render_target FreeTypeLoadTarget
|
||||||
|
---@field freetype_load_flags FreeTypeLoadFlags
|
||||||
|
---@field freetype_interpreter_version u32
|
||||||
|
-- -- Selects the freetype interpret version to use.
|
||||||
|
-- -- Likely values are 35, 38 and 40 which have different
|
||||||
|
-- -- characteristics with respective to subpixel hinting.
|
||||||
|
-- -- See https://freetype.org/freetype2/docs/subpixel-hinting.html
|
||||||
|
---@field freetype_pcf_long_family_names bool
|
||||||
|
---@field harfbuzz_features String[]
|
||||||
|
-- -- Specify the features to enable when using harfbuzz for font shaping.
|
||||||
|
-- -- There is some light documentation here:
|
||||||
|
-- -- <https://harfbuzz.github.io/shaping-opentype-features.html>
|
||||||
|
-- -- but it boils down to allowing opentype feature names to be specified
|
||||||
|
-- -- using syntax similar to the CSS font-feature-settings options:
|
||||||
|
-- -- <https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings>.
|
||||||
|
-- -- The OpenType spec lists a number of features here:
|
||||||
|
-- -- <https://docs.microsoft.com/en-us/typography/opentype/spec/featurelist>
|
||||||
|
-- --
|
||||||
|
-- -- Options of likely interest will be:
|
||||||
|
-- --
|
||||||
|
-- -- * `calt` - <https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae#tag-calt>
|
||||||
|
-- -- * `clig` - <https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae#tag-clig>
|
||||||
|
-- --
|
||||||
|
-- -- If you want to disable ligatures in most fonts, then you may want to
|
||||||
|
-- -- use a setting like this:
|
||||||
|
-- --
|
||||||
|
-- -- ```toml
|
||||||
|
-- -- harfbuzz_features ["calt=0", "clig=0", "liga=0"]
|
||||||
|
-- -- ```
|
||||||
|
-- --
|
||||||
|
-- -- Some fonts make available extended options via stylistic sets.
|
||||||
|
-- -- If you use the [Fira Code font](https://github.com/tonsky/FiraCode)
|
||||||
|
-- -- it lists available stylistic sets here:
|
||||||
|
-- -- <https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylistic-sets>
|
||||||
|
-- --
|
||||||
|
-- -- and you can set them in wezterm:
|
||||||
|
-- --
|
||||||
|
-- -- ```toml
|
||||||
|
-- -- # Use this for a zero with a dot rather than a line through it
|
||||||
|
-- -- # when using the Fira Code font
|
||||||
|
-- -- harfbuzz_features ["zero"]
|
||||||
|
-- -- ```
|
||||||
|
---@field front_end FrontEndSelection
|
||||||
|
---@field webgpu_power_preference WebGpuPowerPreference
|
||||||
|
-- -- Whether to select the higher powered discrete GPU when
|
||||||
|
-- -- the system has a choice of integrated or discrete.
|
||||||
|
-- -- Defaults to low power.
|
||||||
|
---@field webgpu_force_fallback_adapter bool
|
||||||
|
---@field webgpu_preferred_adapter GpuInfo
|
||||||
|
---@field wsl_domains WslDomain[]
|
||||||
|
---@field exec_domains ExecDomain[]
|
||||||
|
---@field serial_ports SerialDomain[]
|
||||||
|
---@field unix_domains UnixDomain[]
|
||||||
|
-- -- The set of unix domains
|
||||||
|
---@field ssh_domains SSHDomainObj[]
|
||||||
|
---@field ssh_backend SshBackend
|
||||||
|
---@field tls_servers TlsDomainServer[]
|
||||||
|
-- -- When running in server mode, defines configuration for
|
||||||
|
-- -- each of the endpoints that we'll listen for connections
|
||||||
|
---@field tls_clients TlsDomainClient[]
|
||||||
|
-- -- The set of tls domains that we can connect to as a client
|
||||||
|
---@field ratelimit_mux_line_prefetches_per_second u32
|
||||||
|
-- -- Constrains the rate at which the multiplexer client will
|
||||||
|
-- -- speculatively fetch line data.
|
||||||
|
-- -- This helps to avoid saturating the link between the client
|
||||||
|
-- -- and server if the server is dumping a large amount of output
|
||||||
|
-- -- to the client.
|
||||||
|
---@field mux_output_parser_buffer_size usize
|
||||||
|
-- -- The buffer size used by parse_buffered_data in the mux module.
|
||||||
|
-- -- This should not be too large, otherwise the processing cost
|
||||||
|
-- -- of applying a batch of actions to the terminal will be too
|
||||||
|
-- -- high and the user experience will be laggy and less responsive.
|
||||||
|
---@field mux_output_parser_coalesce_delay_ms u64
|
||||||
|
-- -- How many ms to delay after reading a chunk of output
|
||||||
|
-- -- in order to try to coalesce fragmented writes into
|
||||||
|
-- -- a single bigger chunk of output and reduce the chances
|
||||||
|
-- -- observing "screen tearing" with un-synchronized output
|
||||||
|
---@field mux_env_remove String[]
|
||||||
|
---@field keys Key[]
|
||||||
|
---@field key_tables {[String]: Key[]}
|
||||||
|
---@field bypass_mouse_reporting_modifiers Modifiers
|
||||||
|
---@field debug_key_events bool
|
||||||
|
---@field normalize_output_to_unicode_nfc bool
|
||||||
|
---@field disable_default_key_bindings bool
|
||||||
|
---@field leader LeaderKey
|
||||||
|
---@field disable_default_quick_select_patterns bool
|
||||||
|
---@field quick_select_patterns String[]
|
||||||
|
---@field quick_select_alphabet String
|
||||||
|
---@field mouse_bindings Mouse[]
|
||||||
|
---@field disable_default_mouse_bindings bool
|
||||||
|
---@field daemon_options DaemonOptions
|
||||||
|
---@field send_composed_key_when_left_alt_is_pressed bool
|
||||||
|
---@field send_composed_key_when_right_alt_is_pressed bool
|
||||||
|
---@field macos_forward_to_ime_modifier_mask Modifiers
|
||||||
|
---@field treat_left_ctrlalt_as_altgr bool
|
||||||
|
---@field swap_backspace_and_delete bool
|
||||||
|
-- -- If true, the `Backspace` and `Delete` keys generate `Delete` and `Backspace`
|
||||||
|
-- -- keypresses, respectively, rather than their normal keycodes.
|
||||||
|
-- -- On macOS the default for this is true because its Backspace key
|
||||||
|
-- -- is labeled as Delete and things are backwards.
|
||||||
|
---@field enable_tab_bar bool
|
||||||
|
-- -- If true, display the tab bar UI at the top of the window.
|
||||||
|
-- -- The tab bar shows the titles of the tabs and which is the
|
||||||
|
-- -- active tab. Clicking on a tab activates it.
|
||||||
|
---@field use_fancy_tab_bar bool
|
||||||
|
---@field tab_bar_at_bottom bool
|
||||||
|
---@field mouse_wheel_scrolls_tabs bool
|
||||||
|
---@field show_tab_index_in_tab_bar bool
|
||||||
|
-- -- If true, tab bar titles are prefixed with the tab index
|
||||||
|
---@field show_tabs_in_tab_bar bool
|
||||||
|
---@field show_new_tab_button_in_tab_bar bool
|
||||||
|
---@field tab_and_split_indices_are_zero_based bool
|
||||||
|
-- -- If true, show_tab_index_in_tab_bar uses a zero-based index.
|
||||||
|
-- -- The default is false and the tab shows a one-based index.
|
||||||
|
---@field tab_max_width usize
|
||||||
|
-- -- Specifies the maximum width that a tab can have in the
|
||||||
|
-- -- tab bar. Defaults to 16 glyphs in width.
|
||||||
|
---@field hide_tab_bar_if_only_one_tab bool
|
||||||
|
-- -- If true, hide the tab bar if the window only has a single tab.
|
||||||
|
---@field enable_scroll_bar bool
|
||||||
|
---@field min_scroll_bar_height Dimension
|
||||||
|
---@field enable_wayland bool
|
||||||
|
-- -- If false, do not try to use a Wayland protocol connection
|
||||||
|
-- -- when starting the gui frontend, and instead use X11.
|
||||||
|
-- -- This option is only considered on X11/Wayland systems and
|
||||||
|
-- -- has no effect on macOS or Windows.
|
||||||
|
-- -- The default is true.
|
||||||
|
---@field enable_zwlr_output_manager bool
|
||||||
|
-- -- driver updates without breaking and losing your work.
|
||||||
|
-- -- Whether to prefer EGL over other GL implementations.
|
||||||
|
-- -- EGL on Windows has jankier resize behavior than WGL (which
|
||||||
|
-- -- is used if EGL is unavailable), but EGL survives graphics
|
||||||
|
---@field prefer_egl bool
|
||||||
|
---@field custom_block_glyphs bool
|
||||||
|
---@field anti_alias_custom_block_glyphs bool
|
||||||
|
---@field window_padding WindowPadding
|
||||||
|
-- -- Controls the amount of padding to use around the terminal cell area
|
||||||
|
---@field window_background_image PathBuf
|
||||||
|
-- -- Specifies the path to a background image attachment file.
|
||||||
|
-- -- The file can be any image format that the rust `image`
|
||||||
|
-- -- crate is able to identify and load.
|
||||||
|
-- -- A window background image is rendered into the background
|
||||||
|
-- -- of the window before any other content.
|
||||||
|
-- --
|
||||||
|
-- -- The image will be scaled to fit the window.
|
||||||
|
---@field window_background_gradient Gradient
|
||||||
|
---@field window_background_image_hsb HsbTransform
|
||||||
|
---@field foreground_text_hsb HsbTransform
|
||||||
|
---@field background BackgroundLayer[]
|
||||||
|
---@field macos_window_background_blur i64
|
||||||
|
-- -- Only works on MacOS
|
||||||
|
---@field win32_system_backdrop SystemBackdrop
|
||||||
|
-- -- Only works on Windows
|
||||||
|
---@field win32_acrylic_accent_color RgbaColor
|
||||||
|
---@field window_background_opacity f32
|
||||||
|
-- -- Specifies the alpha value to use when rendering the background
|
||||||
|
-- -- of the window. The background is taken either from the
|
||||||
|
-- -- window_background_image, or if there is none, the background
|
||||||
|
-- -- color of the cell in the current position.
|
||||||
|
-- -- The default is 1.0 which is 100% opaque. Setting it to a number
|
||||||
|
-- -- between 0.0 and 1.0 will allow for the screen behind the window
|
||||||
|
-- -- to "shine through" to varying degrees.
|
||||||
|
-- -- This only works on systems with a compositing window manager.
|
||||||
|
-- -- Setting opacity to a value other than 1.0 can impact render
|
||||||
|
-- -- performance.
|
||||||
|
---@field inactive_pane_hsb HsbTransform
|
||||||
|
-- -- inactive_pane_hue, inactive_pane_saturation and
|
||||||
|
-- -- inactive_pane_brightness allow for transforming the color
|
||||||
|
-- -- of inactive panes.
|
||||||
|
-- -- The pane colors are converted to HSV values and multiplied
|
||||||
|
-- -- by these values before being converted back to RGB to
|
||||||
|
-- -- use in the display.
|
||||||
|
-- --
|
||||||
|
-- -- The default is 1.0 which leaves the values as-is.
|
||||||
|
-- --
|
||||||
|
-- -- Modifying the hue changes the hue of the color by rotating
|
||||||
|
-- -- it through the color wheel. It is not as useful as the
|
||||||
|
-- -- other components, but is available "for free" as part of
|
||||||
|
-- -- the colorspace conversion.
|
||||||
|
-- --
|
||||||
|
-- -- Modifying the saturation can add or reduce the amount of
|
||||||
|
-- -- "colorfulness". Making the value smaller can make it appear
|
||||||
|
-- -- more washed out.
|
||||||
|
-- --
|
||||||
|
-- -- Modifying the brightness can be used to dim or increase
|
||||||
|
-- -- the perceived amount of light.
|
||||||
|
-- --
|
||||||
|
-- -- The range of these values is 0.0 and up; they are used to
|
||||||
|
-- -- multiply the existing values, so the default of 1.0
|
||||||
|
-- -- preserves the existing component, whilst 0.5 will reduce
|
||||||
|
-- -- it by half, and 2.0 will double the value.
|
||||||
|
-- --
|
||||||
|
-- -- A subtle dimming effect can be achieved by setting:
|
||||||
|
-- -- inactive_pane_saturation 0.9
|
||||||
|
-- -- inactive_pane_brightness 0.8
|
||||||
|
---@field text_background_opacity f32
|
||||||
|
---@field cursor_blink_rate u64
|
||||||
|
-- -- Specifies how often a blinking cursor transitions between visible
|
||||||
|
-- -- and invisible, expressed in milliseconds.
|
||||||
|
-- -- Setting this to 0 disables blinking.
|
||||||
|
-- -- Note that this value is approximate due to the way that the system
|
||||||
|
-- -- event loop schedulers manage timers; non-zero values will be at
|
||||||
|
-- -- least the interval specified with some degree of slop.
|
||||||
|
---@field cursor_blink_ease_in EasingFunction
|
||||||
|
---@field cursor_blink_ease_out EasingFunction
|
||||||
|
---@field animation_fps u8
|
||||||
|
---@field force_reverse_video_cursor bool
|
||||||
|
---@field default_cursor_style "SteadyBlock" | "BlinkingBlock" | "SteadyUnderline" | "BlinkingUnderline" | "SteadyBar" | "BlinkingBar"
|
||||||
|
-- -- Specifies the default cursor style. various escape sequences
|
||||||
|
-- -- can override the default style in different situations (eg:
|
||||||
|
-- -- an editor can change it depending on the mode), but this value
|
||||||
|
-- -- controls how the cursor appears when it is reset to default.
|
||||||
|
-- -- The default is `SteadyBlock`.
|
||||||
|
-- -- Acceptable values are `SteadyBlock`, `BlinkingBlock`
|
||||||
|
-- -- `SteadyUnderline`, `BlinkingUnderline`, `SteadyBar`
|
||||||
|
-- -- and `BlinkingBar`.
|
||||||
|
---@field text_blink_rate u64
|
||||||
|
-- -- Specifies how often blinking text (normal speed) transitions
|
||||||
|
-- -- between visible and invisible, expressed in milliseconds.
|
||||||
|
-- -- Setting this to 0 disables slow text blinking. Note that this
|
||||||
|
-- -- value is approximate due to the way that the system event loop
|
||||||
|
-- -- schedulers manage timers; non-zero values will be at least the
|
||||||
|
-- -- interval specified with some degree of slop.
|
||||||
|
---@field text_blink_ease_in EasingFunction
|
||||||
|
---@field text_blink_ease_out EasingFunction
|
||||||
|
---@field text_blink_rate_rapid u64
|
||||||
|
-- -- Specifies how often blinking text (rapid speed) transitions
|
||||||
|
-- -- between visible and invisible, expressed in milliseconds.
|
||||||
|
-- -- Setting this to 0 disables rapid text blinking. Note that this
|
||||||
|
-- -- value is approximate due to the way that the system event loop
|
||||||
|
-- -- schedulers manage timers; non-zero values will be at least the
|
||||||
|
-- -- interval specified with some degree of slop.
|
||||||
|
---@field text_blink_rapid_ease_in EasingFunction
|
||||||
|
---@field text_blink_rapid_ease_out EasingFunction
|
||||||
|
---@field hide_mouse_cursor_when_typing bool
|
||||||
|
-- -- If true, the mouse cursor will be hidden while typing.
|
||||||
|
-- -- This option is true by default.
|
||||||
|
---@field periodic_stat_logging u64
|
||||||
|
-- -- If non-zero, specifies the period (in seconds) at which various
|
||||||
|
-- -- statistics are logged. Note that there is a minimum period of
|
||||||
|
-- -- 10 seconds.
|
||||||
|
---@field scroll_to_bottom_on_input bool
|
||||||
|
-- -- If false, do not scroll to the bottom of the terminal when
|
||||||
|
-- -- you send input to the terminal.
|
||||||
|
-- -- The default is to scroll to the bottom when you send input
|
||||||
|
-- -- to the terminal.
|
||||||
|
---@field use_ime bool
|
||||||
|
---@field xim_im_name String
|
||||||
|
---@field ime_preedit_rendering "Builtin" | "System" Control IME preedit rendering. IME preedit is an area that is used to display the string being preedited in IME.
|
||||||
|
---@field use_dead_keys bool
|
||||||
|
---@field launch_menu SpawnCommand[]
|
||||||
|
---@field use_box_model_render bool
|
||||||
|
---@field automatically_reload_config bool
|
||||||
|
-- -- When true, watch the config file and reload it automatically
|
||||||
|
-- -- when it is detected as changing.
|
||||||
|
---@field check_for_updates bool
|
||||||
|
---@field show_update_window bool
|
||||||
|
---@field check_for_updates_interval_seconds u64
|
||||||
|
---@field enable_csi_u_key_encoding bool
|
||||||
|
-- -- When set to true, use the CSI-U encoding scheme as described
|
||||||
|
-- -- in http://www.leonerd.org.uk/hacks/fixterms/
|
||||||
|
-- -- This is off by default because @wez and @jsgf find the shift-space
|
||||||
|
-- -- mapping annoying in vim :-p
|
||||||
|
---@field window_close_confirmation "AlwaysPrompt" | "NeverPrompt" Whether to display a confirmation prompt when the window is closed by the windowing environment, either because the user closed it with the window decorations, or instructed their window manager to close it. Set this to "NeverPrompt" if you don't like confirming closing windows every time.
|
||||||
|
---@field native_macos_fullscreen_mode bool
|
||||||
|
---@field selection_word_boundary String
|
||||||
|
---@field enq_answerback String
|
||||||
|
---@field adjust_window_size_when_changing_font_size bool
|
||||||
|
---@field tiling_desktop_environments String[]
|
||||||
|
---@field use_resize_increments bool
|
||||||
|
---@field alternate_buffer_wheel_scroll_speed u8
|
||||||
|
---@field status_update_interval u64
|
||||||
|
---@field experimental_pixel_positioning bool
|
||||||
|
---@field bidi_enabled bool
|
||||||
|
---@field bidi_direction ParagraphDirectionHint
|
||||||
|
---@field skip_close_confirmation_for_processes_named String[]
|
||||||
|
---@field quit_when_all_windows_are_closed bool
|
||||||
|
---@field warn_about_missing_glyphs bool
|
||||||
|
---@field sort_fallback_fonts_by_coverage bool
|
||||||
|
---@field search_font_dirs_for_fallback bool
|
||||||
|
---@field use_cap_height_to_scale_fallback_fonts bool
|
||||||
|
---@field swallow_mouse_click_on_pane_focus bool
|
||||||
|
---@field swallow_mouse_click_on_window_focus bool
|
||||||
|
---@field pane_focus_follows_mouse bool
|
||||||
|
---@field unzoom_on_switch_pane bool
|
||||||
|
---@field max_fps u8 Limits the maximum number of frames per second that wezterm will attempt to draw.
|
||||||
|
---@field shape_cache_size usize
|
||||||
|
---@field line_state_cache_size usize
|
||||||
|
---@field line_quad_cache_size usize
|
||||||
|
---@field line_to_ele_shape_cache_size usize
|
||||||
|
---@field glyph_cache_image_cache_size usize
|
||||||
|
---@field visual_bell VisualBell
|
||||||
|
---@field audible_bell AudibleBell
|
||||||
|
---@field canonicalize_pasted_newlines NewlineCanon
|
||||||
|
---@field unicode_version u8
|
||||||
|
---@field treat_east_asian_ambiguous_width_as_wide bool
|
||||||
|
---@field allow_download_protocols bool
|
||||||
|
---@field allow_win32_input_mode bool
|
||||||
|
---@field default_domain String
|
||||||
|
---@field default_mux_server_domain String
|
||||||
|
---@field default_workspace String
|
||||||
|
---@field xcursor_theme String
|
||||||
|
---@field xcursor_size u32
|
||||||
|
---@field key_map_preference "Mapped" | "Physical" Controls how keys without an explicit phys: or mapped: prefix are treated.
|
||||||
|
---@field quote_dropped_files DroppedFileQuoting
|
||||||
|
---@field ui_key_cap_rendering UIKeyCapRendering
|
||||||
|
---@field palette_max_key_assigments_for_action usize
|
||||||
|
---@field ulimit_nofile u64
|
||||||
|
---@field ulimit_nproc u64
|
||||||
|
local WeztermConfig = {
|
||||||
|
-- The font size, measured in points
|
||||||
|
font_size = 12.0,
|
||||||
|
|
||||||
|
-- must be greater than 0
|
||||||
|
line_height = 1.0,
|
||||||
|
|
||||||
|
-- default = "default_one_point_oh_f64"
|
||||||
|
cell_width = 1.0,
|
||||||
|
|
||||||
|
---@type Dimension
|
||||||
|
-- specified by underline_thickness
|
||||||
|
cursor_thickess = 2.0,
|
||||||
|
|
||||||
|
---@type Dimension
|
||||||
|
-- specified by font
|
||||||
|
underline_thickness = 2.0,
|
||||||
|
|
||||||
|
---@type Dimension
|
||||||
|
underline_position = -2,
|
||||||
|
|
||||||
|
---@type Dimension
|
||||||
|
strikethrough_position = 2.0,
|
||||||
|
|
||||||
|
---@type "Allow" | "Never" | "WhenFollowedBySpace"
|
||||||
|
allow_square_glyphs_to_overflow_width = 'Never',
|
||||||
|
|
||||||
|
---@type WindowDecorations
|
||||||
|
window_decorations = 'TITLE | RESIZE',
|
||||||
|
|
||||||
|
---@type IntegratedTitleButton[]
|
||||||
|
integrated_title_buttons = {'Hide', 'Maximize', 'Close'},
|
||||||
|
|
||||||
|
log_unknown_escape_sequences = false,
|
||||||
|
|
||||||
|
---@type IntegratedTitleButtonAlignment
|
||||||
|
integrated_title_button_alignment = 'Right',
|
||||||
|
|
||||||
|
---@type IntegratedTitleButtonStyle
|
||||||
|
-- default is MacOsNative no Mac, Windows on all others
|
||||||
|
integrated_title_button_style = 'Windows',
|
||||||
|
|
||||||
|
-- Auto or custom color like "red"
|
||||||
|
integrated_title_button_color = 'Auto',
|
||||||
|
|
||||||
|
-- When using FontKitXXX font systems, a set of directories to search ahead of the standard font locations for fonts.
|
||||||
|
-- Relative paths are taken to be relative to the directory from which the config was loaded.
|
||||||
|
-- This tells wezterm to look first for fonts in the directory named `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'},
|
||||||
|
color_scheme_dirs = {'colorschemes'},
|
||||||
|
|
||||||
|
-- The DPI to assume
|
||||||
|
-- Override the detected DPI (dots per inch) for the display.
|
||||||
|
-- This can be useful if the detected DPI is inaccurate and the text appears either blurry or too small (especially if you are using a 4K display on X11 or Wayland).
|
||||||
|
-- The default value is system specific:
|
||||||
|
dpi = 96,
|
||||||
|
|
||||||
|
---@type BoldBrightening
|
||||||
|
-- When true ("BrightAndBold"), PaletteIndex 0-7 are shifted to bright when the font intensity is bold.
|
||||||
|
-- The brightening doesn't apply to text that is the default color.
|
||||||
|
-- can also use true or false for backwards compatibility
|
||||||
|
bold_brightens_ansi_colors = 'BrightAndBold',
|
||||||
|
}
|
||||||
|
|
||||||
|
-- TODO: finish less commonly used conig options (maybe set the defaults, might be too much time)
|
||||||
|
-- -- An optional set of style rules to select the font based
|
||||||
|
-- -- on the cell attributes
|
||||||
|
-- font_rules = Vec<StyleRule>,
|
8
.config/wezterm/types/config/quoted-dropped-files.lua
Executable file
8
.config/wezterm/types/config/quoted-dropped-files.lua
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@alias DroppedFileQuoting
|
||||||
|
---| "None" No quoting is performed, the file name is passed through as-is.
|
||||||
|
---| "SpacesOnly" Backslash-escape only spaces, leaving all other characters as-is. This is the default for non-Windows platforms.
|
||||||
|
---| "Posix" Use POSIX style shell word escaping.
|
||||||
|
---| "Windows" Use Windows style shell word escaping: double-quote filename with space characters in it, and leaving others as-is. This is the default on Windows.
|
||||||
|
---| "WindowsAlwaysQuoted" Like "Windows", while always double-quote the filename.
|
8
.config/wezterm/types/config/ui-key-cap-rendering.lua
Executable file
8
.config/wezterm/types/config/ui-key-cap-rendering.lua
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@alias UIKeyCapRendering
|
||||||
|
---| "UnixLong" - `Super`, `Meta`, `Ctrl`, `Shift`
|
||||||
|
---| "Emacs" - `Super`, `M`, `C`, `S`
|
||||||
|
---| "AppleSymbols" - Use macOS style symbols for Command, Option and so on.
|
||||||
|
---| "WindowsLong" - `Win`, `Alt`, `Ctrl`, `Shift`
|
||||||
|
---| "WindowsSymbols" - Like `WindowsLong` but using a logo for the Win key.
|
16
.config/wezterm/types/config/visual-bell.lua
Executable file
16
.config/wezterm/types/config/visual-bell.lua
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@alias EasingFunction
|
||||||
|
---| "Linear" The fade happens at a constant rate
|
||||||
|
---| "Ease" The fade starts slowly, accelerates sharply, and then slows gradually towards the end. This is the default.
|
||||||
|
---| "EaseIn" The fade starts slowly, and then progressively speeds up until the end, at which point it stops abruptly.
|
||||||
|
---| "EaseInOut" The fade starts slowly, speeds up, and then slows down towards the end.
|
||||||
|
---| "EaseOut" The fade starts abruptly, and then progressively slows down towards the end.
|
||||||
|
---| "{CubicBezier= number[] }" an arbitrary cubic bezier with the specified parameters.
|
||||||
|
---| "Constant" Evaluates as 0 regardless of time. Useful to implement a step transition at the end of the duration.
|
||||||
|
|
||||||
|
---@class VisualBell
|
||||||
|
---@field fade_in_function EasingFunction
|
||||||
|
---@field fade_in_duration_ms EasingFunction
|
||||||
|
---@field fade_out_function EasingFunction
|
||||||
|
---@field fade_out_duration_ms EasingFunction
|
8
.config/wezterm/types/config/win32-system-backdrop.lua
Executable file
8
.config/wezterm/types/config/win32-system-backdrop.lua
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@alias SystemBackdrop
|
||||||
|
---| "Auto" the system chooses. In practice, this is the same as "Disable". This is the default value.
|
||||||
|
---| "Disable" disable backdrop effects.
|
||||||
|
---| "Acrylic" enable the Acrylic blur-behind-window effect. Available on Windows 10 and 11.
|
||||||
|
---| "Mica" enable the Mica effect, available on Windows 11 build 22621 and later.
|
||||||
|
---| "Tabbed" enable the Tabbed effect, available on Windows 11 build 22621 and later.
|
7
.config/wezterm/types/config/window-padding.lua
Executable file
7
.config/wezterm/types/config/window-padding.lua
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class WindowPadding
|
||||||
|
---@field left number | string The number of cells of padding on the left side of the window. You may express padding using a number of different units by specifying a string value with a unit suffix, for example `1px`, `1cell` or `1%`.
|
||||||
|
---@field right number | string The number of cells of padding on the right side of the window. You may express padding using a number of different units by specifying a string value with a unit suffix, for example `1px`, `1cell` or `1%`.
|
||||||
|
---@field top number | string The number of cells of padding on the top side of the window. You may express padding using a number of different units by specifying a string value with a unit suffix, for example `1px`, `1cell` or `1%`.
|
||||||
|
---@field bottom number | string The number of cells of padding on the bottom side of the window. You may express padding using a number of different units by specifying a string value with a unit suffix, for example `1px`, `1cell` or `1%`.
|
5
.config/wezterm/types/enum/copy-mode-assignment.lua
Executable file
5
.config/wezterm/types/enum/copy-mode-assignment.lua
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO:? incomplete
|
||||||
|
|
||||||
|
---@alias CopyModeAssignment "AcceptPattern" | "ClearPattern" | "ClearSelectionMode" | "Close" | "CycleMatchType" | "EditPattern" | "MoveBackwardSemanticZone" | "MoveBackwardSemanticZoneOfType" | "MoveBackwardWord" | "MoveDown" | "MoveForwardSemanticZone" | "MoveForwardSemanticZoneOfType" | "MoveForwardWord" | "MoveForwardWordEnd" | "MoveLeft" | "MoveRight" | "MoveToEndOfLineContent" | "MoveToScrollbackBottom" | "MoveToScrollbackTop" | "MoveToSelectionOtherEnd" | "MoveToSelectionOtherEndHoriz" | "MoveToStartOfLine" | "MoveToStartOfLineContent" | "MoveToStartOfNextLine" | "MoveToViewportBottom" | "MoveToViewportMiddle" | "MoveToViewportTop" | "MoveUp" | "NextMatch" | "NextMatchPage" | "PriorMatch" | "PriorMatchPage" | "SetSelectionMode"
|
175
.config/wezterm/types/enum/key-assignment.lua
Executable file
175
.config/wezterm/types/enum/key-assignment.lua
Executable file
|
@ -0,0 +1,175 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO:? make key and mods more specific
|
||||||
|
|
||||||
|
---@alias KeyAssignment "ActivateCommandPalette" | "ActivateCopyMode" | "ActivateKeyTable" | "ActivateLastTab" | "ActivatePaneByIndex" | "ActivatePaneDirection" | "ActivateTab" | "ActivateTabRelative" | "ActivateTabRelativeNoWrap" | "ActivateWindow" | "ActivateWindowRelative" | "ActivateWindowRelativeNoWrap" | "AdjustPaneSize" | "AttachDomain" | "CharSelect" | "ClearKeyTableStack" | "ClearScrollback" | "ClearSelection" | "CloseCurrentPane" | "CloseCurrentTab" | "CompleteSelection" | "CompleteSelectionOrOpenLinkAtMouseCursor" | "Copy" | "CopyTo" | "DecreaseFontSize" | "DetachDomain" | "DisableDefaultAssignment" | "EmitEvent" | "ExtendSelectionToMouseCursor" | "Hide" | "HideApplication" | "IncreaseFontSize" | "InputSelector" | "MoveTab" | "MoveTabRelative" | "Multiple" | "Nop" | "OpenLinkAtMouseCursor" | "PaneSelect" | "Paste" | "PasteFrom" | "PastePrimarySelection" | "PopKeyTable" | "PromptInputLine" | "QuickSelect" | "QuickSelectArgs" | "QuitApplication" | "ReloadConfiguration" | "ResetFontAndWindowSize" | "ResetFontSize" | "ResetTerminal" | "RotatePanes" | "ScrollByCurrentEventWheelDelta" | "ScrollByLine" | "ScrollByPage" | "ScrollToBottom" | "ScrollToPrompt" | "ScrollToTop" | "Search" | "SelectTextAtMouseCursor" | "SendKey" | "SendString" | "SetPaneZoomState" | "Show" | "ShowDebugOverlay" | "ShowLauncher" | "ShowLauncherArgs" | "ShowTabNavigator" | "SpawnCommandInNewTab" | "SpawnCommandInNewWindow" | "SpawnTab" | "SpawnWindow" | "SplitHorizontal" | "SplitPane" | "SplitVertical" | "StartWindowDrag" | "SwitchToWorkspace" | "SwitchWorkspaceRelative" | "ToggleFullScreen" | "TogglePaneZoomState"
|
||||||
|
|
||||||
|
---@class KeyNoAction
|
||||||
|
---@field key string
|
||||||
|
---@field mods? string
|
||||||
|
|
||||||
|
---@class Key :KeyNoAction
|
||||||
|
---@field action KeyAssignment
|
||||||
|
|
||||||
|
---@class Action can also be called as function like older versions of wezterm did
|
||||||
|
local Action = {}
|
||||||
|
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateCommandPalette = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateCopyMode = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateKeyTable = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateLastTab = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivatePaneByIndex = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivatePaneDirection = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateTab = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateTabRelative = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateTabRelativeNoWrap = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateWindow = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateWindowRelative = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ActivateWindowRelativeNoWrap = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.AdjustPaneSize = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.AttachDomain = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.CharSelect = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ClearKeyTableStack = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ClearScrollback = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ClearSelection = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.CloseCurrentPane = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
---@param param {confirm: boolean}
|
||||||
|
Action.CloseCurrentTab = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.CompleteSelection = function(param) end
|
||||||
|
Action.CompleteSelectionOrOpenLinkAtMouseCursor = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.Copy = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.CopyTo = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.DecreaseFontSize = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.DetachDomain = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.DisableDefaultAssignment = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.EmitEvent = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ExtendSelectionToMouseCursor = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.Hide = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.HideApplication = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.IncreaseFontSize = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.InputSelector = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.MoveTab = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.MoveTabRelative = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.Multiple = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.Nop = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.OpenLinkAtMouseCursor = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.PaneSelect = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.Paste = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.PasteFrom = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.PastePrimarySelection = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.PopKeyTable = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.PromptInputLine = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.QuickSelect = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.QuickSelectArgs = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.QuitApplication = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ReloadConfiguration = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ResetFontAndWindowSize = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ResetFontSize = function(param) end
|
||||||
|
Action.ResetTerminal = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.RotatePanes = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ScrollByCurrentEventWheelDelta = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ScrollByLine = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ScrollByPage = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ScrollToBottom = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ScrollToPrompt = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ScrollToTop = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.Search = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SelectTextAtMouseCursor = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SendKey = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SendString = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SetPaneZoomState = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.Show = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ShowDebugOverlay = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ShowLauncher = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ShowLauncherArgs = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ShowTabNavigator = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SpawnCommandInNewTab = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SpawnCommandInNewWindow = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SpawnTab = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SpawnWindow = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SplitHorizontal = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SplitPane = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SplitVertical = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.StartWindowDrag = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SwitchToWorkspace = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.SwitchWorkspaceRelative = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.ToggleFullScreen = function(param) end
|
||||||
|
---@return KeyAssignment
|
||||||
|
Action.TogglePaneZoomState = function(param) end
|
5
.config/wezterm/types/events/gui.lua
Executable file
5
.config/wezterm/types/events/gui.lua
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: finish
|
||||||
|
|
||||||
|
---@alias GuiEvent "gui-attached" | "gui-startup"
|
5
.config/wezterm/types/events/multiplexer.lua
Executable file
5
.config/wezterm/types/events/multiplexer.lua
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: finish
|
||||||
|
|
||||||
|
---@alias MultiplexerEvent "mux-is-process-stateful" | "mux-startup"
|
5
.config/wezterm/types/events/window.lua
Executable file
5
.config/wezterm/types/events/window.lua
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: finish
|
||||||
|
|
||||||
|
---@alias WindowEvent "augment-command-palette" | "bell" | "format-tab-title" | "format-window-title" | "new-tab-button-click" | "open-uri" | "update-right-status" | "update-status" | "user-var-changed" | "window-config-reloaded" | "window-focus-changed" | "window-resized"
|
|
@ -1,217 +1,494 @@
|
||||||
---@meta
|
---@meta
|
||||||
|
|
||||||
---@class WezTerm
|
--- alias to help identify types that should actually be any
|
||||||
local wezterm = {
|
---@alias ANY any
|
||||||
---@module 'wezterm.color'
|
|
||||||
color = {},
|
|
||||||
|
|
||||||
---@module 'wezterm.gui'
|
---@alias FormatItemAttribute { Underline: "None" | "Single" | "Double" | "Curly" | "Dotted" | "Dashed" } | { Intensity: "Normal" | "Bold" | "Half" } | { Italic: boolean }
|
||||||
gui = {},
|
---@alias FormatItemReset "ResetAttributes" Reset all attributes to default.
|
||||||
|
---@alias FormatItem { Attribute: FormatItemAttribute } | { Foreground: ColorSpec } | { Background: ColorSpec } | { Text: string } | FormatItemReset
|
||||||
|
|
||||||
---@module 'wezterm.mux'
|
---@alias CopyToTarget "Clipboard" | "PrimarySelection" | "ClipboardAndPrimarySelection"
|
||||||
mux = {},
|
|
||||||
|
|
||||||
---@module 'wezterm.procinfo'
|
---@alias SshBackend "Ssh2" | "LibSsh"
|
||||||
procinfo = {},
|
|
||||||
|
|
||||||
---@module 'wezterm.time'
|
---@alias Modifiers "NONE" | "SHIFT" | "ALT" | "CTRL" | "SUPER" | "LEFT_ALT" | "RIGHT_ALT" | "LEFT_CTRL" | "RIGHT_CTRL" | "LEFT_SHIFT" | "RIGHT_SHIFT" | "ENHANCED_KEY"
|
||||||
time = {},
|
---| "LEADER" This is a virtual modifier used by wezterm
|
||||||
|
|
||||||
---@type table<string, any>
|
---@alias WebGpuPowerPreference "LowPower" | "HighPerformance"
|
||||||
GLOBAL = {},
|
|
||||||
|
|
||||||
---@type _.wezterm.KeyAssignment
|
---@alias FontRasterizerSelection "FreeType" Only Option
|
||||||
action = {},
|
|
||||||
|
|
||||||
---@type string
|
---@alias FontShaperSelection
|
||||||
config_dir = '',
|
---| "Allsorts" very preliminary support
|
||||||
|
---| "Harfbuzz" default
|
||||||
|
|
||||||
---@type string
|
---@alias FontLocatorSelection
|
||||||
config_file = '',
|
---| "FontConfig" Use fontconfig APIs to resolve fonts (!macos, posix systems)
|
||||||
|
---| "Gdi" Use GDI on win32 systems
|
||||||
|
---| "CoreText" Use CoreText on macOS
|
||||||
|
---| "ConfigDirsOnly" Use only the font_dirs configuration to locate fonts
|
||||||
|
|
||||||
---@type string
|
---@alias FrontEndSelection
|
||||||
executable_dir = '',
|
---| "OpenGL"
|
||||||
|
---| "WebGpu" default
|
||||||
|
---| "Software"
|
||||||
|
|
||||||
---@type string
|
---@alias DisplayPixelGeometry
|
||||||
home_dir = '',
|
---| "RGB" default
|
||||||
|
---| "BGR"
|
||||||
|
|
||||||
---@type table<string, string>
|
---@alias f32 number
|
||||||
nerdfonts = {},
|
|
||||||
|
|
||||||
---@type string
|
---@alias f64 number
|
||||||
target_triple = '',
|
|
||||||
|
|
||||||
---@type string
|
---@alias u8 integer
|
||||||
version = '',
|
|
||||||
|
|
||||||
---@param callback _.wezterm.ActionCallback
|
---@alias u16 integer
|
||||||
---@return _.wezterm._CallbackAction
|
|
||||||
action_callback = function(callback) end,
|
|
||||||
|
|
||||||
---@param path string
|
---@alias u32 integer
|
||||||
add_to_config_reload_watch_list = function(path) end,
|
|
||||||
|
|
||||||
---@param args string[]
|
---@alias u64 integer
|
||||||
background_child_process = function(args) end,
|
|
||||||
|
|
||||||
---@return _.wezterm.BatteryInfo[]
|
---@alias i64 integer
|
||||||
battery_info = function() end,
|
|
||||||
|
|
||||||
---@param string string
|
---@alias Duration u64
|
||||||
---@return number
|
|
||||||
column_width = function(string) end,
|
|
||||||
|
|
||||||
---@return _.wezterm.ConfigBuilder
|
---@alias usize number
|
||||||
config_builder = function() end,
|
|
||||||
|
|
||||||
---@return _.wezterm.HyperlinkRule[]
|
---@alias String string
|
||||||
default_hyperlink_rules = function() end,
|
|
||||||
|
|
||||||
---@return _.wezterm.SshDomain[]
|
---@alias Regex string
|
||||||
default_ssh_domains = function() end,
|
|
||||||
|
|
||||||
---@return _.wezterm.WslDomain[]
|
---@alias RgbColor string
|
||||||
default_wsl_domains = function() end,
|
--
|
||||||
|
---@alias RgbaColor string
|
||||||
|
|
||||||
---@param event_name string
|
---@alias bool boolean
|
||||||
---@param ... any
|
|
||||||
---@return boolean
|
|
||||||
emit = function(event_name, ...) end,
|
|
||||||
|
|
||||||
---@param ssh_config_file_name? string
|
---@alias BoldBrightening "No" | "BrightAndBold" | "BrightOnly"
|
||||||
---@return table<string, string>
|
|
||||||
enumerate_ssh_hosts = function(ssh_config_file_name) end,
|
|
||||||
|
|
||||||
---@param family string
|
---@alias ExitBehavior "Close" | "CloseOnCleanExit" | "Hold"
|
||||||
---@param attributes? _.wezterm.FontAttributes
|
--TODO: describe
|
||||||
---@return _.wezterm._Font
|
|
||||||
---@overload fun(attributes: _.wezterm.FontAttributesExtended): _.wezterm._Font
|
|
||||||
font = function(family, attributes) end,
|
|
||||||
|
|
||||||
---@param families string[]
|
---@alias ExitBehaviorMessaging "Verbose" | "Brief" | "Terse" | "None"
|
||||||
---@param attributes? _.wezterm.FontAttributes
|
--TODO: describe
|
||||||
---@return _.wezterm._Font
|
|
||||||
---@overload fun(attributes: (string | _.wezterm.FontFallbackAttributesExtended)[]): _.wezterm._Font
|
|
||||||
font_with_fallback = function(families, attributes) end,
|
|
||||||
|
|
||||||
---@param format_items _.wezterm.FormatItem[]
|
---@alias IntegratedTitleButton "Hide" | "Maximize" | "Close"
|
||||||
---@return string
|
|
||||||
format = function(format_items) end,
|
|
||||||
|
|
||||||
---@return table<string, _.wezterm.Palette>
|
---@alias IntegratedTitleButtonAlignment "Right" | "Left"
|
||||||
get_builtin_color_schemes = function() end,
|
|
||||||
|
|
||||||
---@param pattern string
|
---@alias IntegratedTitleButtonStyle "Windows" | "Gnome" | "MacOsNative"
|
||||||
---@param relative_to? string
|
|
||||||
---@return string[]
|
|
||||||
glob = function(pattern, relative_to) end,
|
|
||||||
|
|
||||||
---@param gradient _.wezterm.Gradient
|
---@alias WindowDecorations "NONE" | "TITLE" | "RESIZE" | "TITLE | RESIZE"
|
||||||
---@param num_colors number
|
|
||||||
---@return _.wezterm.Color[]
|
|
||||||
gradient_colors = function(gradient, num_colors) end,
|
|
||||||
|
|
||||||
---@param name string
|
---@alias Points string
|
||||||
---@return boolean
|
-- A value expressed in points, where 72 points == 1 inch.
|
||||||
has_action = function(name) end,
|
|
||||||
|
|
||||||
---@return string
|
---@alias Pixels string | number
|
||||||
hostname = function() end,
|
-- A value expressed in raw pixels
|
||||||
|
|
||||||
---@param value any
|
---@alias Percent string
|
||||||
---@return string
|
-- A value expressed in terms of a fraction of the maximum
|
||||||
json_encode = function(value) end,
|
-- value in the same direction. For example, left padding
|
||||||
|
-- of 10% depends on the pixel width of that element.
|
||||||
|
-- The value is 1.0 == 100%. It is possible to express
|
||||||
|
-- eg: 2.0 for 200%.
|
||||||
|
|
||||||
---@param arg string
|
---@alias Cells string
|
||||||
---@param ... any
|
-- A value expressed in terms of a fraction of the cell
|
||||||
log_error = function(arg, ...) end,
|
-- size computed from the configured font size.
|
||||||
|
-- 1.0 == the cell size.
|
||||||
|
|
||||||
---@param arg string
|
---@alias Dimension Points | Pixels | Percent | Cells
|
||||||
---@param ... any
|
|
||||||
log_info = function(arg, ...) end,
|
|
||||||
|
|
||||||
---@param arg string
|
---@class TabBarColor
|
||||||
---@param ... any
|
-- The color of the background area for the tab
|
||||||
log_warn = function(arg, ...) end,
|
---@field bg_color string
|
||||||
|
-- The color of the text for the tab
|
||||||
|
---@field fg_color string
|
||||||
|
-- Specify whether you want "Half", "Normal" or "Bold" intensity for the
|
||||||
|
-- label shown for this tab.
|
||||||
|
-- The default is "Normal"
|
||||||
|
---@field intensity "Half" | "Normal" | "Bold"
|
||||||
|
-- Specify whether you want "None", "Single" or "Double" underline for
|
||||||
|
-- label shown for this tab.
|
||||||
|
-- The default is "None"
|
||||||
|
---@field underline "None" | "Single" | "Double"
|
||||||
|
-- Specify whether you want the text to be italic (true) or not (false)
|
||||||
|
-- for this tab. The default is false.
|
||||||
|
---@field italic boolean
|
||||||
|
-- Specify whether you want the text to be rendered with strikethrough (true)
|
||||||
|
-- or not for this tab. The default is false.
|
||||||
|
---@field strikethrough boolean
|
||||||
|
|
||||||
---@overload fun(event_name: 'format-tab-title', callback: fun(tab: _.wezterm.TabInformation, tabs: _.wezterm.TabInformation[], panes: _.wezterm.PaneInformation, config: table, hover: boolean, max_width: integer): string | _.wezterm.FormatItem[]): nil
|
---@class TabBarColors
|
||||||
---@overload fun(event_name: 'update-right-status', callback: fun(window: _.wezterm.Window, pane: _.wezterm.Pane): nil): nil
|
---@field background string The text color to use when the attributes are reset to default
|
||||||
---@overload fun(event_name: 'window-config-reloaded', callback: fun(window: _.wezterm.Window, pane: _.wezterm.Pane): nil): nil
|
---@field inactive_tab_edge string
|
||||||
on = function(event_name, callback) end,
|
---@field inactive_tab_edge_hover string
|
||||||
|
|
||||||
---@param path_or_url string
|
---@alias AnsiColors "Black" | "Maroon" | "Green" | "Olive" | "Navy" | "Purple" | "Teal" | "Silver" | "Grey" | "Red" | "Lime" | "Yellow" | "Blue" | "Fuchsia" | "Aqua" | "White"
|
||||||
---@param application? string
|
|
||||||
open_with = function(path_or_url, application) end,
|
|
||||||
|
|
||||||
---@param string string
|
---@alias AC "AnsiColor"
|
||||||
---@param min_width number
|
|
||||||
---@return string
|
|
||||||
pad_left = function(string, min_width) end,
|
|
||||||
|
|
||||||
---@param string string
|
---@alias CO "Color"
|
||||||
---@param min_width number
|
|
||||||
---@return string
|
|
||||||
pad_right = function(string, min_width) end,
|
|
||||||
|
|
||||||
---@param table _.wezterm.MouseBindingBase
|
---@alias ColorSpec table<AC, AnsiColors> | table<CO, string>
|
||||||
---@return _.wezterm.MouseBinding ...
|
|
||||||
---@overload fun(table: _.wezterm.KeyBindingBase): _.wezterm.KeyBinding ...
|
|
||||||
permute_any_mods = function(table) end,
|
|
||||||
|
|
||||||
---@param table _.wezterm.MouseBindingBase
|
---@class Palette
|
||||||
---@return _.wezterm.MouseBinding ...
|
---@field foreground string The text color to use when the attributes are reset to default
|
||||||
---@overload fun(table: _.wezterm.KeyBindingBase): _.wezterm.KeyBinding ...
|
---@field background string The background color to use when the attributes are reset to default
|
||||||
permute_any_or_no_mods = function(table) end,
|
---@field cursor_fg string The color of the cursor
|
||||||
|
---@field cursor_bg string The color of the cursor
|
||||||
|
---@field cursor_border string The color of the cursor
|
||||||
|
---@field selection_fg string The color of selected text
|
||||||
|
---@field selection_bg string The color of selected text
|
||||||
|
---@field ansi string[] A list of 8 colors corresponding to the basic ANSI palette
|
||||||
|
---@field brights string[] A list of 8 colors corresponding to bright versions of the
|
||||||
|
---@field indexed { [number]: string } A map for setting arbitrary colors ranging from 16 to 256 in the color palette
|
||||||
|
---@field scrollbar_thumb string The color of the "thumb" of the scrollbar; the segment that represents the current viewable area
|
||||||
|
---@field split string The color of the split line between panes
|
||||||
|
---@field visual_bell string The color of the visual bell. If unspecified, the foreground color is used instead.
|
||||||
|
---@field compose_cursor string The color to use for the cursor when a dead key or leader state is active
|
||||||
|
---@field copy_mode_active_highlight_fg ColorSpec
|
||||||
|
---@field copy_mode_active_highlight_bg ColorSpec
|
||||||
|
---@field copy_mode_inactive_highlight_fg ColorSpec
|
||||||
|
---@field copy_mode_inactive_highlight_bg ColorSpec
|
||||||
|
---@field quick_select_label_fg ColorSpec
|
||||||
|
---@field quick_select_label_bg ColorSpec
|
||||||
|
---@field quick_select_match_fg ColorSpec
|
||||||
|
---@field quick_select_match_bg ColorSpec
|
||||||
|
local Palette = {
|
||||||
|
---@class TabBar :TabBarColors
|
||||||
|
-- Configure the color and styling for the tab bar
|
||||||
|
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',
|
||||||
|
|
||||||
---@param path string
|
---@type TabBarColor
|
||||||
---@return string[]
|
-- The active tab is the one that has focus in the window
|
||||||
read_dir = function(path) end,
|
active_tab = {
|
||||||
|
-- The color of the background area for the tab
|
||||||
|
bg_color = '#2b2042',
|
||||||
|
-- The color of the text for the tab
|
||||||
|
fg_color = '#c0c0c0',
|
||||||
|
|
||||||
reload_configuration = function() end,
|
-- Specify whether you want "Half", "Normal" or "Bold" intensity for the
|
||||||
|
-- label shown for this tab.
|
||||||
|
-- The default is "Normal"
|
||||||
|
intensity = 'Normal',
|
||||||
|
|
||||||
---@param args string[]
|
-- Specify whether you want "None", "Single" or "Double" underline for
|
||||||
---@return boolean, string, string
|
-- label shown for this tab.
|
||||||
run_child_process = function(args) end,
|
-- The default is "None"
|
||||||
|
underline = 'None',
|
||||||
|
|
||||||
---@return boolean
|
-- Specify whether you want the text to be italic (true) or not (false)
|
||||||
running_under_wsl = function() end,
|
-- for this tab. The default is false.
|
||||||
|
italic = false,
|
||||||
|
|
||||||
---@param args string[]
|
-- Specify whether you want the text to be rendered with strikethrough (true)
|
||||||
---@return string
|
-- or not for this tab. The default is false.
|
||||||
shell_join_args = function(args) end,
|
strikethrough = false,
|
||||||
|
},
|
||||||
|
|
||||||
---@param line string
|
---@type TabBarColor
|
||||||
---@return string|string[]
|
-- Inactive tabs are the tabs that do not have focus
|
||||||
shell_quote_arg = function(line) end,
|
inactive_tab = {
|
||||||
|
bg_color = '#1b1032',
|
||||||
|
fg_color = '#808080',
|
||||||
|
},
|
||||||
|
|
||||||
---@param milliseconds number
|
---@type TabBarColor
|
||||||
sleep_ms = function(milliseconds) end,
|
-- You can configure some alternate styling when the mouse pointer
|
||||||
|
-- moves over inactive tabs
|
||||||
|
inactive_tab_hover = {
|
||||||
|
bg_color = '#3b3052',
|
||||||
|
fg_color = '#909090',
|
||||||
|
italic = true,
|
||||||
|
},
|
||||||
|
|
||||||
---@param str string
|
---@type TabBarColor
|
||||||
---@return string[]
|
-- The new tab button that let you create new tabs
|
||||||
split_by_newlines = function(str) end,
|
new_tab = {
|
||||||
|
bg_color = '#1b1032',
|
||||||
|
fg_color = '#808080',
|
||||||
|
},
|
||||||
|
|
||||||
---@param format string
|
---@type TabBarColor
|
||||||
---@return string
|
-- You can configure some alternate styling when the mouse pointer
|
||||||
strftime = function(format) end,
|
-- moves over the new tab button
|
||||||
|
new_tab_hover = {
|
||||||
|
bg_color = '#3b3052',
|
||||||
|
fg_color = '#909090',
|
||||||
|
italic = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
---@param format string
|
|
||||||
---@return string
|
|
||||||
strftime_utc = function(format) end,
|
|
||||||
|
|
||||||
---@param string string
|
|
||||||
---@param min_width number
|
|
||||||
---@return string
|
|
||||||
truncate_left = function(string, min_width) end,
|
|
||||||
|
|
||||||
---@param string string
|
|
||||||
---@param min_width number
|
|
||||||
---@return string
|
|
||||||
truncate_right = function(string, min_width) end,
|
|
||||||
|
|
||||||
---@param str string
|
|
||||||
---@return string
|
|
||||||
utf16_to_utf8 = function(str) end,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return wezterm
|
---@alias FontWeight "Thin" | "ExtraLight" | "Light" | "DemiLight" | "Book" | "Regular" | "Medium" | "DemiBold" | "Bold" | "ExtraBold" | "Black" | "ExtraBlack"
|
||||||
|
---@alias FontStretch "UltraCondensed" | "ExtraCondensed" | "Condensed" | "SemiCondensed" | "Normal" | "SemiExpanded" | "Expanded" | "ExtraExpanded" | "UltraExpanded"
|
||||||
|
---@alias FontStyle "Normal" | "Italic" | "Oblique"
|
||||||
|
---@alias FreeTypeLoadTarget "Normal" | "Light" | "Mono" | "HorizontalLcd" | "VerticalLcd"
|
||||||
|
---@alias FreeTypeLoadFlags "DEFAUlT" | "NO_HINTING" | "NO_BITMAP" | "FORCE_AUTOHINT" | "MONOCHROME" | "NO_AUTOHINT"
|
||||||
|
|
||||||
|
--TODO: = add harfbuzz_features enum
|
||||||
|
--
|
||||||
|
---@alias Fonts {fonts: FontAttributes[]}
|
||||||
|
|
||||||
|
---@class FontAttributes
|
||||||
|
---@field is_fallback? boolean
|
||||||
|
---@field is_synthetic? boolean
|
||||||
|
---@field harfbuzz_features? string[]
|
||||||
|
---@field assume_emoji_presentation? boolean
|
||||||
|
---@field scale? number
|
||||||
|
local FontAttributes = {
|
||||||
|
-- The font family name
|
||||||
|
family = 'JetBrains Mono',
|
||||||
|
---@type FontWeight
|
||||||
|
-- Whether the font should be a bold variant
|
||||||
|
weight = 'Regular',
|
||||||
|
---@type FontStretch
|
||||||
|
stretch = 'Normal',
|
||||||
|
---@type FontStyle
|
||||||
|
-- Whether the font should be an italic variant
|
||||||
|
style = 'Normal',
|
||||||
|
---@type FreeTypeLoadTarget
|
||||||
|
freetype_load_target = 'Normal',
|
||||||
|
---@type FreeTypeLoadTarget
|
||||||
|
freetype_render_target = 'Normal',
|
||||||
|
---@type FreeTypeLoadFlags
|
||||||
|
-- you can combine the flags like 'NO_HINTING|MONOCHROME' -- probably would not want to
|
||||||
|
freetype_load_flags = 'DEFAUlT',
|
||||||
|
}
|
||||||
|
|
||||||
|
---@class WindowFrameConfig
|
||||||
|
---@field inactive_titlebar_bg RgbColor
|
||||||
|
---@field active_titlebar_bg RgbColor
|
||||||
|
---@field inactive_titlebar_fg RgbColor
|
||||||
|
---@field active_titlebar_fg RgbColor
|
||||||
|
---@field inactive_titlebar_border_bottom RgbColor
|
||||||
|
---@field active_titlebar_border_bottom RgbColor
|
||||||
|
---@field button_fg RgbColor
|
||||||
|
---@field button_bg RgbColor
|
||||||
|
---@field button_hover_fg RgbColor
|
||||||
|
---@field button_hover_bg RgbColor
|
||||||
|
---@field border_left_width Dimension
|
||||||
|
---@field border_right_width Dimension
|
||||||
|
---@field border_top_height Dimension
|
||||||
|
---@field border_bottom_height Dimension
|
||||||
|
---@field border_left_color RgbaColor
|
||||||
|
---@field border_right_color RgbaColor
|
||||||
|
---@field border_top_color RgbaColor
|
||||||
|
---@field border_bottom_color RgbaColor
|
||||||
|
|
||||||
|
---@class TabBarStyle
|
||||||
|
---@field new_tab String
|
||||||
|
---@field new_tab_hover String
|
||||||
|
---@field window_hide String
|
||||||
|
---@field window_hide_hover String
|
||||||
|
---@field window_maximize String
|
||||||
|
---@field window_maximize_hover String
|
||||||
|
---@field window_close String
|
||||||
|
---@field window_close_hover String
|
||||||
|
|
||||||
|
---@class HyperlinkRule
|
||||||
|
---@field regex Regex
|
||||||
|
---@field format String
|
||||||
|
---@field highlight usize
|
||||||
|
|
||||||
|
---@class SerialDomain
|
||||||
|
---@field name String
|
||||||
|
-- The name of this specific domain. Must be unique amongst
|
||||||
|
-- all types of domain in the configuration file.
|
||||||
|
---@field port String
|
||||||
|
-- Specifies the serial device name.
|
||||||
|
-- On Windows systems this can be a name like `COM0`.
|
||||||
|
-- On posix systems this will be something like `/dev/ttyUSB0`.
|
||||||
|
-- If omitted, the name will be interpreted as the port.
|
||||||
|
---@field baud usize
|
||||||
|
-- Set the baud rate. The default is 9600 baud.
|
||||||
|
|
||||||
|
---@class GpuInfo
|
||||||
|
---@field name String
|
||||||
|
---@field device_type String
|
||||||
|
---@field backend String
|
||||||
|
---@field driver String
|
||||||
|
---@field driver_info String
|
||||||
|
---@field vendor u32
|
||||||
|
---@field device u32
|
||||||
|
|
||||||
|
---@class UnixDomain
|
||||||
|
---@field name String
|
||||||
|
-- The name of this specific domain. Must be unique amongst
|
||||||
|
-- all types of domain in the configuration file.
|
||||||
|
---@field socket_path PathBuf
|
||||||
|
-- The path to the socket. If unspecified, a resonable default
|
||||||
|
-- value will be computed.
|
||||||
|
---@field connect_automatically bool
|
||||||
|
-- If true, connect to this domain automatically at startup
|
||||||
|
---@field no_serve_automatically bool
|
||||||
|
-- If true, do not attempt to start this server if we try and fail to
|
||||||
|
-- connect to it.
|
||||||
|
---@field serve_command String[]
|
||||||
|
-- If we decide that we need to start the server, the command to run
|
||||||
|
-- to set that up. The default is to spawn:
|
||||||
|
-- `wezterm-mux-server --daemonize`
|
||||||
|
-- but it can be useful to set this to eg:
|
||||||
|
-- `wsl -e wezterm-mux-server --daemonize` to start up
|
||||||
|
-- a unix domain inside a wsl container.
|
||||||
|
---@field proxy_command String[]
|
||||||
|
-- Instead of directly connecting to `socket_path`
|
||||||
|
-- spawn this command and use its stdin/stdout in place of
|
||||||
|
-- the socket.
|
||||||
|
---@field skip_permissions_check bool
|
||||||
|
-- If true, bypass checking for secure ownership of the socket_path. This is not recommended on a multi-user system, but is useful for example when running the server inside a WSL container but with the socket on the host NTFS volume.
|
||||||
|
---@field read_timeout Duration
|
||||||
|
---@field write_timeout Duration
|
||||||
|
---@field local_echo_threshold_ms u64
|
||||||
|
-- Don't use default_local_echo_threshold_ms() here to disable the predictive echo for Unix domains by default.
|
||||||
|
---@field overlay_lag_indicator bool
|
||||||
|
-- Show time since last response when waiting for a response. It is recommended to use <https://wezfurlong.org/wezterm/config/lua/pane/get_metadata.html#since_last_response_ms> instead.
|
||||||
|
|
||||||
|
---@class LeaderKey :KeyNoAction
|
||||||
|
---@field timeout_milliseconds? u64 - `leader` stays active until a keypress is registered (whether it matches a key binding or not), or until it has been active for the duration specified by `timeout_milliseconds`, at which point it will automatically cancel itself.
|
||||||
|
|
||||||
|
---@class HyperLinkRule
|
||||||
|
---@field regex string The regular expression to match
|
||||||
|
---@field format string Controls which parts of the regex match will be used to form the link. Must have a prefix: signaling the protocol type (e.g., https:/mailto:), which can either come from the regex match or needs to be explicitly added. The format string can use placeholders like $0, $1, $2 etc. that will be replaced with that numbered capture group. So, $0 will take the entire region of text matched by the whole regex, while $1 matches out the first capture group. In the example below, mailto:$0 is used to prefix a protocol to the text to make it into an URL.
|
||||||
|
---@field highlight number? Specifies the range of the matched text that should be highlighted/underlined when the mouse hovers over the link. The value is a number that corresponds to a capture group in the regex. The default is 0, highlighting the entire region of text matched by the regex. 1 would be the first capture group, and so on.
|
||||||
|
|
||||||
|
---@class BatteryInfo
|
||||||
|
---@field state_of_charge number The battery level expressed as a number between 0.0 (empty) and 1.0 (full)
|
||||||
|
---@field vendor string Battery manufacturer name, or "unknown" if not known.
|
||||||
|
---@field model string The battery model string, or "unknown" if not known.
|
||||||
|
---@field serial string The battery serial number, or "unknown" if not known.
|
||||||
|
---@field time_to_full number? If charging, how long until the battery is full (in seconds). May be nil.
|
||||||
|
---@field time_to_empty number? If discharing, how long until the battery is empty (in seconds). May be nil.
|
||||||
|
---@field state "Charging" | "Discharging" | "Empty" | "Full" | "Unknown"
|
||||||
|
|
||||||
|
---@class PluginResponse
|
||||||
|
---@field apply_to_config fun(config: Config, ...: any): any Function that accepts at least a config builder parameter, but may pass other parameters, or a lua table with a `config` field that maps to a config build parameter.
|
||||||
|
|
||||||
|
---@class WeztermPlugin
|
||||||
|
---@field require fun(url: string): PluginResponse Takes a plugin repo URL (string). This plugin has to return a `apply_to_config` function that accepts at least a config builder parameter
|
||||||
|
---@field list fun(): Plugin[] -- 'list' function: returns an array of Plugin objects
|
||||||
|
---@field update_all fun(): nil -- 'update_all' function: performs updates, returns nothing
|
||||||
|
|
||||||
|
---@class Plugin -- Represents the RepoSpec struct in Lua
|
||||||
|
---@field url string -- The URL of the plugin repository
|
||||||
|
---@field component string -- The component or directory name of the plugin
|
||||||
|
---@field plugin_dir string -- The path to the plugin's directory
|
||||||
|
|
||||||
|
---@class AugmentCommandPaletteReturn
|
||||||
|
---@field brief string The brief description for the entry
|
||||||
|
---@field doc string? A long description that may be shown after the entry, or that may be used in future versions of wezterm to provide more information about the command.
|
||||||
|
---@field action KeyAssignment The action to take when the item is activated. Can be any key assignment action.
|
||||||
|
---@field icon NerdFont? optional Nerd Fonts glyph name to use for the icon for the entry. See wezterm.nerdfonts for a list of icon names.
|
||||||
|
|
||||||
|
---@alias CallbackWindowPane fun(window: Window, pane: Pane)
|
||||||
|
---@alias EventAugmentCommandPalette fun(event: "augment-command-palette", callback: fun(window: Window, pane: Window): AugmentCommandPaletteReturn): nil This event is emitted when the Command Palette is shown. It's purpose is to enable you to add additional entries to the list of commands shown in the palette. This hook is synchronous; calling asynchronous functions will not succeed.
|
||||||
|
---@alias EventBell fun(event: "augment-command-palette", callback: CallbackWindowPane) The bell event is emitted when the ASCII BEL sequence is emitted to a pane in the window. Defining an event handler doesn't alter wezterm's handling of the bell; the event supplements it and allows you to take additional action over the configured behavior.
|
||||||
|
---@alias EventFormatTabTitle fun(event: "format-tab-title", callback: fun(tab: TabInformation, tabs: TabInformation[], panes: PaneInformation[], config: Config, hover: boolean, max_width: number): string | FormatItem) When the tab bar is computed, this event is called twice for each tab; on the first pass, `hover` will be `false` and `max_width` will be set to tab_max_width. WezTerm will then compute the tab widths that will fit in the tab bar, and then call the event again for the set of tabs, this time with appropriate `hover` and `max_width` values.
|
||||||
|
---@alias EventFormatWindowTitle fun(event: "format-window-title", callback: fun(window: Window, pane: Pane, tabs: MuxTabObj[], panes: Pane[], config: Config)) TODO
|
||||||
|
---@alias EventNewTabButtonClick fun(event: "new-tab-button-click", callback: fun(window: Window, pane: Pane, button: "Left" | "Middle" | "Right", default_action: KeyAssignment): nil) TODO
|
||||||
|
---@alias EventOpenUri fun(event: "open-uri", callback: fun(window: Window, pane: Pane, uri: string): nil) TODO
|
||||||
|
---@alias EventUpdateRightStatus fun(event: "update-right-status", callback: CallbackWindowPane) TODO
|
||||||
|
---@alias EventUpdateStatus fun(event: "update-status", callback: CallbackWindowPane) TODO
|
||||||
|
---@alias EventUserVarChanged fun(event: "user-var-changed", callback: fun(window: Window, pane: Pane, name: string, value: string): nil) TODO
|
||||||
|
---@alias EventWindowConfigReloaded fun(event: "window-config-reloaded", callback: CallbackWindowPane) TODO
|
||||||
|
---@alias EventWindowFocusChanged fun(event: "window-focus-changed", callback: CallbackWindowPane) TODO
|
||||||
|
---@alias EventWindowResized fun(event: "window-resized", callback: CallbackWindowPane) TODO
|
||||||
|
---@alias EventCustom fun(event: string, callback: fun(...: any): nil) A custom declared function
|
||||||
|
|
||||||
|
---@alias CursorShape "SteadyBlock" | "BlinkingBlock" | "SteadyUnderline" | "BlinkingUnderline" | "SteadyBar" | "BlinkingBar"
|
||||||
|
---@alias CursorVisibility "Visible" | "Hidden"
|
||||||
|
|
||||||
|
---@class StableCursorPosition
|
||||||
|
---@field x number The horizontal cell index.
|
||||||
|
---@field y number the vertical stable row index.
|
||||||
|
---@field shape CursorShape The CursorShape enum value.
|
||||||
|
---@field visibility CursorVisibility The CursorVisibility enum value.
|
||||||
|
|
||||||
|
---@class LinearGradientOrientation
|
||||||
|
---@field angle number
|
||||||
|
|
||||||
|
---@class RadialGradientOrientation
|
||||||
|
---@field radius? number
|
||||||
|
---@field cx? number
|
||||||
|
---@field cy? number
|
||||||
|
|
||||||
|
---@class Gradient
|
||||||
|
---@field colors string[]
|
||||||
|
---@field orientation? 'Horizontal' | 'Vertical' | { Linear: LinearGradientOrientation } | { Radial: RadialGradientOrientation }
|
||||||
|
---@field interpolation? 'Linear' | 'Basis' | 'CatmullRom'
|
||||||
|
---@field blend? 'Rgb' | 'LinearRgb' | 'Hsv' | 'Oklab'
|
||||||
|
---@field noise? number
|
||||||
|
---@field segment_size? number
|
||||||
|
---@field segment_smoothness? number
|
||||||
|
|
||||||
|
---@class HsbTransform
|
||||||
|
---@field hue number
|
||||||
|
---@field saturation number
|
||||||
|
---@field brightness number
|
||||||
|
|
||||||
|
---@class ColorSchemeMetaData
|
||||||
|
---@field name? string
|
||||||
|
---@field author? string
|
||||||
|
---@field origin_url? string
|
||||||
|
---@field wezterm_version? string
|
||||||
|
---@field aliases? string[]
|
||||||
|
|
||||||
|
---@alias ActionCallback fun(win: Window, pane: Pane, ...: any): (nil | false)
|
||||||
|
---@alias AnsiColor 'Black' | 'Maroon' | 'Green' | 'Olive' | 'Navy' | 'Purple' | 'Teal' | 'Silver' | 'Grey' | 'Red' | 'Lime' | 'Yellow' | 'Blue' | 'Fuchsia' | 'Aqua' | 'White'
|
||||||
|
---@alias Appearance 'Light' | 'Dark' | 'LightHighContrast' | 'DarkHighContrast'
|
||||||
|
---@alias Clipboard 'Clipboard' | 'PrimarySelection' | 'ClipboardAndPrimarySelection'
|
||||||
|
---@alias CopyMode 'AcceptPattern' | 'ClearPattern' | 'ClearSelectionMode' | 'Close' | 'CycleMatchType' | 'EditPattern' | 'MoveBackwardSemanticZone' | { MoveBackwardSemanticZoneOfType: SemanticZoneType } | 'MoveBackwardWord' | 'MoveDown' | 'MoveForwardSemanticZone' | { MoveForwardSemanticZoneOfType: SemanticZoneType } | 'MoveForwardWord' | 'MoveForwardWordEnd' | 'MoveLeft' | 'MoveRight' | 'MoveToEndOfLineContent' | 'MoveToScrollbackBottom' | 'MoveToScrollbackTop' | 'MoveToSelectionOtherEnd' | 'MoveToSelectionOtherEndHoriz' | 'MoveToStartOfLine' | 'MoveToStartOfLineContent' | 'MoveToStartOfNextLine' | 'MoveToViewportBottom' | 'MoveToViewportMiddle' | 'MoveToViewportTop' | 'MoveUp' | 'NextMatch' | 'NextMatchPage' | 'PriorMatch' | 'PriorMatchPage' | { SetSelectionMode: SelectionMode | 'SemanticZone' }
|
||||||
|
---@alias CursorStyle 'BlinkingBlock' | 'SteadyBlock' | 'BlinkingUnderline' | 'SteadyUnderline' | 'BlinkingBar' | 'SteadyBar'
|
||||||
|
---@alias Direction 'Left' | 'Right' | 'Up' | 'Down' | 'Next' | 'Prev'
|
||||||
|
---@alias FreetypeLoadTarget 'Normal' | 'Light' | 'Mono' | 'HorizontalLcd'
|
||||||
|
---@alias SelectionMode 'Cell' | 'Word' | 'Line' | 'Block'
|
||||||
|
---@alias SemanticZoneType 'Prompt' | 'Input' | 'Output'
|
||||||
|
---@alias Stretch 'UltraCondensed' | 'ExtraCondensed' | 'Condensed' | 'SemiCondensed' | 'Normal' | 'SemiExpanded' | 'Expanded' | 'ExtraExpanded' | 'UltraExpanded'
|
||||||
|
---@alias Style 'Normal' | 'Italic' | 'Oblique'
|
||||||
|
---@alias Weight 'Thin' | 'ExtraLight' | 'Light' | 'DemiLight' | 'Book' | 'Regular' | 'Medium' | 'DemiBold' | 'Bold' | 'ExtraBold' | 'Black' | 'ExtraBlack'
|
||||||
|
|
||||||
|
---@class ScreenInformation
|
||||||
|
---@field name string
|
||||||
|
---@field x number
|
||||||
|
---@field y number
|
||||||
|
---@field height number
|
||||||
|
---@field width number
|
||||||
|
---@field max_fps? number
|
||||||
|
|
||||||
|
---@class KeyBindingBase
|
||||||
|
---@field key string
|
||||||
|
---@field action Action
|
||||||
|
|
||||||
|
---@class KeyBinding: KeyBindingBase
|
||||||
|
---@field mods string
|
||||||
|
|
||||||
|
---@class MouseEventInfo
|
||||||
|
---@field streak number
|
||||||
|
---@field button 'Left' | 'Right' | 'Middle' | { WheelDown: number } | { WheelUp: number }
|
||||||
|
|
||||||
|
---@class MouseDownEvent
|
||||||
|
---@field Down MouseEventInfo
|
||||||
|
|
||||||
|
---@class MouseUpEvent
|
||||||
|
---@field Up MouseEventInfo
|
||||||
|
|
||||||
|
---@class MouseDragEvent
|
||||||
|
---@field Drag MouseEventInfo
|
||||||
|
|
||||||
|
---@alias MouseEvent MouseDownEvent | MouseUpEvent | MouseDragEvent
|
||||||
|
|
||||||
|
---@class MouseBindingBase
|
||||||
|
---@field event MouseEvent
|
||||||
|
---@field action Action
|
||||||
|
---@field mouse_reporting? boolean
|
||||||
|
---@field alt_screen? boolean | 'Any'
|
||||||
|
|
||||||
|
---@class MouseBinding: MouseBindingBase
|
||||||
|
---@field mods string
|
||||||
|
|
23
.config/wezterm/types/objects/color.lua
Executable file
23
.config/wezterm/types/objects/color.lua
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class Color
|
||||||
|
---@field adjust_hue_fixed fun(self: Color, degrees: number): Color Adjust the hue angle by the specified number of degrees.
|
||||||
|
---@field adjust_hue_fixed_ryb fun(self: Color, degrees: number): Color Adjust the hue angle by the specified number of degrees.
|
||||||
|
---@field complement fun(self: Color): Color Returns the complement of the color. The complement is computed by converting to HSL, rotating by 180 degrees and converting back to RGBA.
|
||||||
|
---@field complement_ryb fun(self: Color): Color Returns the complement of the color using the RYB color model, which more closely matches how artists think of mixing colors.
|
||||||
|
---@field contrast_ratio fun(self: Color, other: Color): number Computes the contrast ratio between the two colors.
|
||||||
|
---@field darken fun(self: Color, amount: number): Color Scales the color towards the minimum lightness by the provided factor, which should be in the range 0.0 through 1.0.
|
||||||
|
---@field darken_fixed fun(self: Color, amount: number): Color Decrease the lightness by amount, a value ranging from 0.0 to 1.0.
|
||||||
|
---@field delta_e fun(self: Color, other: Color): number Computes the CIEDE2000 DeltaE value representing the difference between the two colors.
|
||||||
|
---@field desaturate fun(self: Color, amount: number): Color Scales the color towards the minimum saturation by the provided factor, which should be in the range 0.0 through 1.0.
|
||||||
|
---@field desaturate_fixed fun(self: Color, amount: number): Color Decrease the saturation by amount, a value ranging from 0.0 to 1.0.
|
||||||
|
---@field hsla fun(self: Color): { h: number, s: number, l: number, a: number } Converts the color to the HSL colorspace and returns those values + alpha.
|
||||||
|
---@field laba fun(self: Color): { l: number, a: number, b: number, a: number } Converts the color to the LAB colorspace and returns those values + alpha.
|
||||||
|
---@field lighten fun(self: Color, amount: number): Color Scales the color towards the maximum lightness by the provided factor, which should be in the range 0.0 through 1.0.
|
||||||
|
---@field lighten_fixed fun(self: Color, amount: number): Color Increase the lightness by amount, a value ranging from 0.0 to 1.0.
|
||||||
|
---@field linear_rgba fun(self: Color): { r: number, g: number, b: number, a: number } Returns a tuple of the colors converted to linear RGBA and expressed as floating point numbers in the range 0.0-1.0.
|
||||||
|
---@field saturate fun(self: Color, amount: number): Color Scales the color towards the maximum saturation by the provided factor, which should be in the range 0.0 through 1.0.
|
||||||
|
---@field saturate_fixed fun(self: Color, amount: number): Color Increase the saturation by amount, a value ranging from 0.0 to 1.0.
|
||||||
|
---@field square fun(self: Color): { a: Color, b: Color, c: Color } Returns the other three colors that form a square. The other colors are 90 degrees apart on the HSL color wheel.
|
||||||
|
---@field srgb_u8 fun(self: Color): { r: number, g: number, b: number, a: number } Returns a tuple of the internal SRGBA colors expressed as unsigned 8-bit integers in the range 0-255.
|
||||||
|
---@field triad fun(self: Color): { a: Color, b: Color } Returns the other two colors that form a triad. The other colors are at +/- 120 degrees in the HSL color wheel.
|
12
.config/wezterm/types/objects/exec-domain.lua
Executable file
12
.config/wezterm/types/objects/exec-domain.lua
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: finish? fixup_function autocomplete not work when calling
|
||||||
|
-- think it is lua language server callback function param types issue
|
||||||
|
|
||||||
|
---@class ExecDomain
|
||||||
|
local ExecDomain = {}
|
||||||
|
|
||||||
|
---@param domain_name string
|
||||||
|
---@param fixup_function function(cmd: SpawnCommand): SpawnCommand
|
||||||
|
---@param label? string
|
||||||
|
ExecDomain.exec_domain = function(domain_name, fixup_function, label) end
|
15
.config/wezterm/types/objects/local-process-info.lua
Executable file
15
.config/wezterm/types/objects/local-process-info.lua
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@alias LocalProcessStatus 'Idle' | 'Run' | 'Sleep' | 'Stop' | 'Zombie' | 'Tracing' | 'Dead' | 'Wakekill' | 'Waking' | 'Parked' | 'LockBlocked' | 'Unknown'
|
||||||
|
|
||||||
|
---@class LocalProcessInfo
|
||||||
|
---@field pid number The process identifier
|
||||||
|
---@field ppid number The parent process identifier
|
||||||
|
---@field name string The COMM name of the process. May not bear any relation to the executable image name. May be changed at runtime by the process. Many systems truncate this field to 15-16 characters.
|
||||||
|
---@field executable PathBuf Path to the executable image
|
||||||
|
---@field argv string[] The argument vector. Some systems allow changing the argv block at runtime eg: setproctitle().
|
||||||
|
---@field cwd string The current working directory for the process, or an empty path if it was not accessible for some reason.
|
||||||
|
---@field status LocalProcessStatus -- The status of the process. Not all possible values are portably supported on all systems.
|
||||||
|
---@field start_time number A clock value in unspecified system dependent units that indicates the relative age of the process.
|
||||||
|
---@field console number The console handle associated with the process, if any.
|
||||||
|
---@field children table<u32, LocalProcessInfo> -- Child processes, keyed by pid
|
11
.config/wezterm/types/objects/mux-domain.lua
Executable file
11
.config/wezterm/types/objects/mux-domain.lua
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class MuxDomainObj
|
||||||
|
---@field attach fun(self: MuxDomainObj): nil Attempts to attach the domain. Attaching a domain will attempt to import the windows, tabs and panes from the remote system into those of the local GUI. Unlike the AttachDomain key assignment, calling domain:attach() will not implicitly spawn a new pane into the domain if the domain contains no panes. This is to provide flexibility when used in the gui-startup event. If the domain is already attached, calling this method again has no effect.
|
||||||
|
---@field detach fun(self: MuxDomainObj): nil Attempts to detach the domain. Detaching a domain causes it to disconnect and remove its set of windows, tabs and panes from the local GUI. Detaching does not cause those panes to close; if or when you later attach to the domain, they'll still be there. Not every domain supports detaching, and will log an error to the error log/debug overlay.
|
||||||
|
---@field domain_id fun(self: MuxDomainObj): number Returns the domain id.
|
||||||
|
---@field has_any_panes fun(self: MuxDomainObj): boolean Returns true if the mux has any panes that belong to this domain. This can be useful when deciding whether to spawn additional panes after attaching to a domain.
|
||||||
|
---@field is_spawnable fun(self: MuxDomainObj): boolean Returns false if this domain will never be able to spawn a new pane/tab/window, true otherwise. Serial ports are represented by a serial domain that is not spawnable.
|
||||||
|
---@field label fun(self: MuxDomainObj): string Computes a label describing the name and state of the domain. The label can change depending on the state of the domain.
|
||||||
|
---@field name fun(self: MuxDomainObj): string Returns the name of the domain. Domain names are unique; no two domains can have the same name, and the name is fixed for the lifetime of the domain.
|
||||||
|
---@field state fun(self: MuxDomainObj): "Attached" | "Detached" Returns whether the domain is attached or not.
|
16
.config/wezterm/types/objects/mux-tab.lua
Executable file
16
.config/wezterm/types/objects/mux-tab.lua
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class MuxTabObj
|
||||||
|
---@field activate fun(self: MuxTabObj): nil Activates (focuses) the tab.
|
||||||
|
---@field active_pane fun(self): Pane A convenience accessor for returning the active pane in the tab.
|
||||||
|
---@field get_pane_direction fun(self: MuxTabObj, direction: "Left" | "Right" | "Up" | "Down" | "Prev" | "Next"): MuxTabObj Returns pane adjacent to the active pane in tab in the direction direction.
|
||||||
|
---@field get_size fun(self: MuxTabObj): {rows: number, cols: number, pixel_width: number, pixel_height: number, dpi: number} Returns the overall size of the tab, taking into account all of the contained panes.
|
||||||
|
---@field get_title fun(self: MuxTabObj): string Returns the tab title as set by `tab:set_title()`.
|
||||||
|
---@field panes fun(self: MuxTabObj): Pane[] Returns an array table containing the set of Pane objects contained by this tab.
|
||||||
|
---@field panes_with_info fun(self: MuxTabObj): {index: number, is_active: boolean, is_zoomed: boolean, left: number, top: number, width: number, height: number, pixel_width: number, pixel_height: number, pane: Pane}[] Returns an array table containing an extended info entry for each of the panes contained by this tab.
|
||||||
|
---@field rotate_clockwise fun(self: MuxTabObj): nil Rotates the panes in the clockwise direction.
|
||||||
|
---@field rotate_counter_clockwise fun(self: MuxTabObj): nil Rotates the panes in the counter-clockwise direction.
|
||||||
|
---@field set_title fun(self: MuxTabObj, title: string): nil Sets the tab title to the provided string.
|
||||||
|
---@field set_zoomed fun(self: MuxTabObj, state: boolean): boolean Sets the zoomed state for the active pane within this tab. A zoomed pane takes up all available space in the tab, hiding all other panes while it is zoomed. Switching its zoom state off will restore the prior split arrangement. Setting the zoom state to true zooms the pane if it wasn't already zoomed. Setting the zoom state to false un-zooms the pane if it was zoomed. Returns the prior zoom state.
|
||||||
|
---@field tab_id fun(self: MuxTabObj): number Returns the tab id.
|
||||||
|
---@field window fun(self: MuxTabObj): MuxWindow Returns the MuxWindow object that contains this tab.
|
14
.config/wezterm/types/objects/mux-window.lua
Executable file
14
.config/wezterm/types/objects/mux-window.lua
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class MuxWindow
|
||||||
|
---@field active_pane fun(self: MuxWindow): Pane A convenience accessor for returning the active pane in the active tab of the window.
|
||||||
|
---@field active_tab fun(self: MuxWindow): MuxTabObj A convenience accessor for returning the active tab within the window.
|
||||||
|
---@field get_title fun(self: MuxWindow): string Returns the window title as set by OSC 0, OSC 2 in a contained pane, or through `window:set_title()`.
|
||||||
|
---@field get_workspace fun(self: MuxWindow) string Returns the name of the workspace to which the window belongs.
|
||||||
|
---@field gui_window fun(self: MuxWindow): Window Attempts to resolve this mux window to its corresponding Gui Window. This may not succeed for a couple of reasons: If called by the multiplexer daemon, there is no gui, so this will never succeed, If the mux window is part of a workspace that is not the active workspace.
|
||||||
|
---@field set_title fun(self: MuxWindow): nil Sets the window title to the provided string. Note that applications may subsequently change the title via escape sequences.
|
||||||
|
---@field set_workspace fun(self: MuxWindow): nil Changes the name of the workspace to which the window belongs.
|
||||||
|
---@field spawn_tab fun(self: MuxWindow): { tab: MuxTabObj, pane: Pane, window: MuxWindow } Spawns a program into a new tab within this window, returning the MuxTab, Pane and MuxWindow objects associated with it. When no arguments are passed, the default program is spawned. TODO
|
||||||
|
---@field tabs fun(self: MuxWindow): MuxTabObj[] Returns an array table holding each of the MuxTab objects contained within this window.
|
||||||
|
---@field tabs_with_info fun(self: MuxWindow): { index: number, is_active: boolean, tab: MuxTabObj }[] Returns an array table holding an extended info entry for each of the tabs contained within this window.
|
||||||
|
---@field window_id fun(self: MuxWindow): number Returns the window multiplexer id.
|
20
.config/wezterm/types/objects/pane-information.lua
Executable file
20
.config/wezterm/types/objects/pane-information.lua
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class PaneInformation
|
||||||
|
---@field pane_id number The pane idenfitier number.
|
||||||
|
---@field pane_index number The logical position of the pane within its containing layout.
|
||||||
|
---@field is_active boolean Is true if the pane is the active pane within its containing tab.
|
||||||
|
---@field is_zoomed boolean Is true if the pane is in the zoomed state.
|
||||||
|
---@field left number The cell x coordinate of the left edge of the pane.
|
||||||
|
---@field top number The cell y coordinate of the top edge of the pane.
|
||||||
|
---@field width number The width of the pane in cells.
|
||||||
|
---@field height number The height of the pane in cells.
|
||||||
|
---@field pixel_width number The width of the pane in pixels.
|
||||||
|
---@field pixel_height number The height of the pane in pixels.
|
||||||
|
---@field title string The title of the pane, per `pane:get_title()` at the time the pane information was captured.
|
||||||
|
---@field user_vars table<string, string> The user variables defined for the pane, per `pane:get_user_vars()` at the time the pane information was captured.
|
||||||
|
---@field foreground_process_name string The path to the executable image per `pane:get_foreground_process_name()`, or an empty string if unavailable.
|
||||||
|
---@field current_working_dir string The current working directory, per `pane:get_current_working_dir()`.
|
||||||
|
---@field has_unseen_output boolean Is true if the there has been output in the pane since the last time it was focused.
|
||||||
|
---@field domain_name string The name of the domain with which the pane is associated.
|
||||||
|
---@field tty_name string The tty name with the same constraints as described in `pane:get_tty_name()`.
|
33
.config/wezterm/types/objects/pane.lua
Executable file
33
.config/wezterm/types/objects/pane.lua
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class Pane
|
||||||
|
---@field activate fun(self: Pane): nil Activates (focuses) the pane and its containing tab.
|
||||||
|
---@field get_current_working_dir fun(self: Pane): string | Url Returns the current working directory of the pane, if known. The current directory can be specified by an application sending OSC 7. On newer versions of wezterm, it returns a `Url` object.
|
||||||
|
---@field get_cursor_position fun(self: Pane): StableCursorPosition Returns a lua representation of the StableCursorPosition struct that identifies the cursor position, visibility and shape.
|
||||||
|
---@field get_dimensions fun(self: Pane): RenderableDimensions Returns a lua representation of the RenderableDimensions struct that identifies the dimensions and position of the viewport as well as the scrollback for the pane.
|
||||||
|
---@field get_domain_name fun(self: Pane): string Returns the name of the domain with which the pane is associated.
|
||||||
|
---@field get_foreground_process_info fun(self: Pane): LocalProcessInfo Returns a LocalProcessInfo object corresponding to the current foreground process that is running in the pane.
|
||||||
|
---@field get_foreground_process_name fun(self: Pane): string Returns the path to the executable image for the pane.
|
||||||
|
---@field get_lines_as_text fun(self: Pane, lines: number?): string Returns the textual representation (not including color or other attributes) of the physical lines of text in the viewport as a string. A physical line is a possibly-wrapped line that composes a row in the terminal display matrix. If you'd rather operate on logical lines, see pane:get_logical_lines_as_text. If the optional nlines argument is specified then it is used to determine how many lines of text should be retrieved. The default (if nlines is not specified) is to retrieve the number of lines in the viewport (the height of the pane). The lines have trailing space removed from each line. The lines will be joined together in the returned string separated by a \n character. Trailing blank lines are stripped, which may result in fewer lines being returned than you might expect if the pane only had a couple of lines of output.
|
||||||
|
---@field get_logical_lines_as_text fun(self: Pane, lines: number?): string Returns the textual representation (not including color or other attributes) of the logical lines of text in the viewport as a string. A logical line is an original input line prior to being wrapped into physical lines to composes rows in the terminal display matrix. WezTerm doesn't store logical lines, but can recompute them from metadata stored in physical lines. Excessively long logical lines are force-wrapped to constrain the cost of rewrapping on resize and selection operations. If you'd rather operate on physical lines, see pane:get_lines_as_text. If the optional nlines argument is specified then it is used to determine how many lines of text should be retrieved. The default (if nlines is not specified) is to retrieve the number of lines in the viewport (the height of the pane). The lines have trailing space removed from each line. The lines will be joined together in the returned string separated by a \n character. Trailing blank lines are stripped, which may result in fewer lines being returned than you might expect if the pane only had a couple of lines of output.
|
||||||
|
---@field get_metadata fun(self: Pane): PaneMetadata? Returns metadata about a pane. The return value depends on the instance of the underlying pane. If the pane doesn't support this method, nil will be returned. Otherwise, the value is a lua table with the metadata contained in table fields.
|
||||||
|
---@field get_semantic_zone_at fun(self: Pane): any TODO
|
||||||
|
---@field get_semantic_zones fun(self: Pane): any TODO
|
||||||
|
---@field get_text_from_region fun(self: Pane, start_x: number, start_y: number, end_x: number, end_y: number): string Returns the text from the specified region.
|
||||||
|
---@field get_text_from_semantic_zone fun(self: Pane): any TODO
|
||||||
|
---@field get_title fun(self: Pane): string Returns the title of the pane. This will typically be wezterm by default but can be modified by applications that send OSC 1 (Icon/Tab title changing) and/or OSC 2 (Window title changing) escape sequences. The value returned by this method is the same as that used to display the tab title if this pane were the only pane in the tab; if OSC 1 was used to set a non-empty string then that string will be returned. Otherwise the value for OSC 2 will be returned. Note that on Microsoft Windows the default behavior of the OS level PTY is to implicitly send OSC 2 sequences to the terminal as new programs attach to the console. If the title text is wezterm and the pane is a local pane, then wezterm will attempt to resolve the executable path of the foreground process that is associated with the pane and will use that instead of wezterm.
|
||||||
|
---@field get_tty_name fun(self: Pane): string? Returns the tty device name, or nil if the name is unavailable.
|
||||||
|
---@field get_user_vars fun(self: Pane): { [string]: string } Returns a table holding the user variables that have been assigned to this pane. User variables are set using an escape sequence defined by iterm2, but also recognized by wezterm; this example sets the foo user variable to the value bar:
|
||||||
|
---@field has_unseen_output fun(self: Pane): boolean Returns true if there has been output in the pane since the last time the time the pane was focused.
|
||||||
|
---@field inject_output fun(self: Pane, text: string): nil Sends text, which may include escape sequences, to the output side of the current pane. The text will be evaluated by the terminal emulator and can thus be used to inject/force the terminal to process escape sequences that adjust the current mode, as well as sending human readable output to the terminal. Note that if you move the cursor position as a result of using this method, you should expect the display to change and for text UI programs to get confused. Not all panes support this method; at the time of writing, this works for local panes but not for multiplexer panes.
|
||||||
|
---@field is_alt_screen_active fun(self: Pane): boolean Returns whether the alternate screen is active for the pane. The alternate screen is a secondary screen that is activated by certain escape codes. The alternate screen has no scrollback, which makes it ideal for a "full-screen" terminal program like vim or less to do whatever they want on the screen without fear of destroying the user's scrollback. Those programs emit escape codes to return to the normal screen when they exit.
|
||||||
|
---@field move_to_new_tab fun(self: Pane): { tab: MuxTabObj, window: MuxWindow } Creates a new tab in the window that contains pane, and moves pane into that tab. Returns the newly created MuxTab object, and the MuxWindow object that contains it.
|
||||||
|
---@field move_to_new_window fun(self: Pane, workspace: string?): { tab: MuxTabObj, window: MuxWindow } Creates a window and moves pane into that window. The WORKSPACE parameter is optional; if specified, it will be used as the name of the workspace that should be associated with the new window. Otherwise, the current active workspace will be used. Returns the newly created MuxTab object, and the newly created MuxWindow object.
|
||||||
|
---@field mux_pane fun(self: Pane): nil **DEPRECATED**
|
||||||
|
---@field pane_id fun(self: Pane): number Returns the id number for the pane. The Id is used to identify the pane within the internal multiplexer and can be used when making API calls via wezterm cli to indicate the subject of manipulation.
|
||||||
|
---@field paste fun(self: Pane, text: string): nil Sends the supplied text string to the input of the pane as if it were pasted from the clipboard, except that the clipboard is not involved. If the terminal attached to the pane is set to bracketed paste mode then the text will be sent as a bracketed paste. Otherwise the string will be streamed into the input in chunks of approximately 1KB each.
|
||||||
|
---@field send_paste fun(self: Pane, text: string): nil Sends text to the pane as though it was pasted. If bracketed paste mode is enabled then the text will be sent as a bracketed paste. Otherwise, it will be sent as-is.
|
||||||
|
---@field send_text fun(self: Pane, text: string): nil Sends text to the pane as-is.
|
||||||
|
---@field split fun(self: Pane): Pane TODO
|
||||||
|
---@field tab fun(self: Pane): MuxTabObj? the MuxTab that contains this pane. Note that this method can return nil when pane is a GUI-managed overlay pane (such as the debug overlay), because those panes are not managed by the mux layer.
|
||||||
|
---@field window fun(self: Pane): MuxWindow Returns the MuxWindow that contains the tab that contains this pane.
|
7
.config/wezterm/types/objects/spawn-command.lua
Executable file
7
.config/wezterm/types/objects/spawn-command.lua
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: finish
|
||||||
|
|
||||||
|
---@class SpawnCommand
|
||||||
|
local SpawnCommand = {}
|
||||||
|
SpawnCommand.foo = "bar"
|
10
.config/wezterm/types/objects/ssh-domain.lua
Executable file
10
.config/wezterm/types/objects/ssh-domain.lua
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
---@meta
|
||||||
|
--
|
||||||
|
---@class SSHDomainObj
|
||||||
|
---@field name string The name of this specific domain. Must be unique amongst all types of domain in the configuration file.
|
||||||
|
---@field remote_address string 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.
|
||||||
|
---@field no_agent_auth boolean Whether agent auth should be disabled. Set to true to disable it.
|
||||||
|
---@field username string The username to use for authenticating with the remote host.
|
||||||
|
---@field connect_automatically boolean If true, connect to this domain automatically at startup
|
||||||
|
---@field timeout number Specify an alternative read timeout
|
||||||
|
---@field remote_wezterm_path string 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.
|
10
.config/wezterm/types/objects/tab-information.lua
Executable file
10
.config/wezterm/types/objects/tab-information.lua
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class TabInformation
|
||||||
|
---@field tab_id number The identifier for the tab
|
||||||
|
---@field tab_index number The logical tab position within its containing window, with 0 indicating the leftmost tab
|
||||||
|
---@field is_active boolean Is true if this tab is the active tab
|
||||||
|
---@field active_pane PaneInformation The PaneInformation for the active pane in this tab
|
||||||
|
---@field window_id number The ID of the window that contains this tab
|
||||||
|
---@field window_title string The title of the window that contains this tab
|
||||||
|
---@field tab_title string The title of the tab
|
4
.config/wezterm/types/objects/time.lua
Executable file
4
.config/wezterm/types/objects/time.lua
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
---@class TimeObj
|
||||||
|
---@field format fun(self: TimeObj, format: string): string Formats the time object as a string, using the local date/time representation of the time.
|
||||||
|
---@field format_utc fun(self: TimeObj, format: string): string Formats the time object as a string, using the UTC date/time representation of the time.
|
||||||
|
---@field sun_times fun(self: TimeObj, lat: number, lon: number): { rise: TimeObj, set: TimeObj, progression: number, up: boolean } For the date component of the time object, compute the times of the sun rise and sun set for the given latitude and longitude.
|
45
.config/wezterm/types/objects/tls-domain-client.lua
Executable file
45
.config/wezterm/types/objects/tls-domain-client.lua
Executable file
|
@ -0,0 +1,45 @@
|
||||||
|
---@class TlsDomainClient
|
||||||
|
---@field name String
|
||||||
|
-- The name of this specific domain. Must be unique amongst
|
||||||
|
-- all types of domain in the configuration file.
|
||||||
|
---@field bootstrap_via_ssh String
|
||||||
|
-- If set, use ssh to connect, start the server, and obtain
|
||||||
|
-- a certificate.
|
||||||
|
-- The value is "user@host:port", just like "wezterm ssh" accepts.
|
||||||
|
---@field remote_address String
|
||||||
|
-- identifies the host:port pair of the remote server.
|
||||||
|
---@field pem_private_key PathBuf
|
||||||
|
-- the path to an x509 PEM encoded private key file
|
||||||
|
---@field pem_cert PathBuf
|
||||||
|
-- the path to an x509 PEM encoded certificate file
|
||||||
|
---@field pem_ca PathBuf
|
||||||
|
-- the path to an x509 PEM encoded CA chain file
|
||||||
|
---@field pem_root_certs PathBuf[]
|
||||||
|
-- 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.
|
||||||
|
---@field accept_invalid_hostnames bool
|
||||||
|
-- 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.
|
||||||
|
---@field expected_cn String
|
||||||
|
-- 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.
|
||||||
|
---@field connect_automatically bool
|
||||||
|
-- If true, connect to this domain automatically at startup
|
||||||
|
---@field read_timeout Duration
|
||||||
|
---@field write_timeout Duration
|
||||||
|
---@field local_echo_threshold_ms u64
|
||||||
|
-- The path to the wezterm binary on the remote host
|
||||||
|
---@field remote_wezterm_path String
|
||||||
|
-- Show time since last response when waiting for a response.
|
||||||
|
-- It is recommended to use
|
||||||
|
-- <https://wezfurlong.org/wezterm/config/lua/pane/get_metadata.html#since_last_response_ms>
|
||||||
|
-- instead.
|
||||||
|
---@field overlay_lag_indicator bool
|
16
.config/wezterm/types/objects/tls-domain-server.lua
Executable file
16
.config/wezterm/types/objects/tls-domain-server.lua
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
---@class TlsDomainServer
|
||||||
|
---@field bind_address String
|
||||||
|
-- The address:port combination on which the server will listen
|
||||||
|
-- for client connections
|
||||||
|
---@field pem_private_key PathBuf
|
||||||
|
-- the path to an x509 PEM encoded private key file
|
||||||
|
---@field pem_cert PathBuf
|
||||||
|
-- the path to an x509 PEM encoded certificate file
|
||||||
|
---@field pem_ca PathBuf
|
||||||
|
-- the path to an x509 PEM encoded CA chain file
|
||||||
|
---@field pem_root_certs PathBuf[]
|
||||||
|
-- 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.
|
11
.config/wezterm/types/objects/url.lua
Executable file
11
.config/wezterm/types/objects/url.lua
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class Url
|
||||||
|
---@field scheme string The URL scheme such as "file", or "https"
|
||||||
|
---@field file_path string Decodes the path field and interprets it as a file path
|
||||||
|
---@field username string The username portion of the URL, or an empty string if none is specified
|
||||||
|
---@field password string The password portion of the URL, or nil if none is specified
|
||||||
|
---@field host string The hostname portion of the URL, with IDNA decoded to UTF-8
|
||||||
|
---@field path string The path portion of the URL, complete with percent encoding
|
||||||
|
---@field fragment string The fragment portion of the URL
|
||||||
|
---@field query string The query portion of the URL
|
32
.config/wezterm/types/objects/window.lua
Executable file
32
.config/wezterm/types/objects/window.lua
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class Window
|
||||||
|
---@field active_key_table fun(self: Window): string Returns a string holding the top of the current key table activation stack, or nil if the stack is empty. See [Key Tables](https://wezfurlong.org/wezterm/config/key-tables.html) for a detailed example.
|
||||||
|
---@field active_pane fun(self: Window): Pane A convenience accessor for returning the active pane in the active tab of the GUI window. This is similar to [mux_window:active_pane()](https://wezfurlong.org/wezterm/config/lua/window/active_pane.html) but, because it operates at the GUI layer, it can return *Pane* objects for special overlay panes that are not visible to the mux layer of the API.
|
||||||
|
---@field active_tab fun(self: Window): MuxTabObj A convenience accessor for returning the active tab within the window.
|
||||||
|
---@field active_workspace fun(self: Window): string Returns the name of the active workspace. This example demonstrates using the launcher menu to select and create workspaces, and how the workspace can be shown in the right status area.
|
||||||
|
---@field composition_status fun(self: Window): string? Returns a string holding the current dead key or IME composition text, or nil if the input layer is not in a composition state. This is the same text that is shown at the cursor position when composing.
|
||||||
|
---@field copy_to_clipboard fun(self: Window, text: string, target: CopyToTarget?): nil Puts text into the specified clipboard.
|
||||||
|
---@field current_event fun(self: Window): string Returns the current event. For now only implemented for mouse events. #TODO: type annotate the Event
|
||||||
|
---@field effective_config fun(self: Window): Config Returns a lua table representing the effective configuration for the Window. The table is in the same format as that used to specify the config in the wezterm.lua file, but represents the fully-populated state of the configuration, including any CLI or per-window configuration overrides. Note: changing the config table will NOT change the effective window config; it is just a copy of that information.
|
||||||
|
---@field focus fun(self: Window): nil Attempts to focus and activate the window.
|
||||||
|
---@field get_appearance fun(self: Window): "Light" | "Dark" | "LightHighContrast" | "DarkHighContrast" Returns the appearance of the window environment.
|
||||||
|
---@field get_config_overrides fun(self: Window): Config Returns a copy of the current set of configuration overrides that is in effect for the window. See `set_config_overrides` for examples!
|
||||||
|
---@field get_dimensions fun(self: Window): { pixel_width: number, pixel_height: number, dpi: number, is_full_screen: boolean } Returns a Lua table representing the dimensions for the Window.
|
||||||
|
---@field get_selection_escapes_for_pane fun(self: Window): string Returns the text that is currently selected within the specified pane within the specified window formatted with the escape sequences necessary to reproduce the same colors and styling. This is the same text that `window:get_selection_text_for_pane()` would return, except that it includes escape sequences.
|
||||||
|
---@field get_selection_text_for_pane fun(self: Window): string Returns the text that is currently selected within the specified pane within the specified window. This is the same text that would be copied to the clipboard if the CopyTo action were to be performed. Why isn't this simply a method of the `pane` object? The reason is that the selection is an attribute of the containing window, and a given pane can potentially be mapped into multiple windows.
|
||||||
|
---@field is_focused fun(self: Window): boolean Returns true if the window has focus. The update-status event is fired when the focus state changes.
|
||||||
|
---@field keyboard_modifiers fun(self: Window): { mods: string, leds: string } Returns two values; the keyboard modifiers and the key status leds. Both values are exposed to lua as strings with |-delimited values representing the various modifier keys and keyboard led states: Modifiers - is the same form as keyboard assignment modifiers Leds - possible flags are "CAPS_LOCK" and "NUM_LOCK". Note that macOS doesn't have a num lock concept.
|
||||||
|
---@field leader_is_active fun(self: Window): boolean Returns true if the Leader Key is active in the window, or false otherwise.
|
||||||
|
---@field maximize fun(self: Window): nil Puts the window into the maximized state. Use `window:restore()` to return to the normal/non-maximized state.
|
||||||
|
---@field mux_window fun(self: Window): MuxWindow Returns the MuxWindow representation of this window.
|
||||||
|
---@field perform_action fun(self: Window, key_assignment: KeyAssignment, pane: Pane): nil Performs a key assignment against the window and pane. There are a number of actions that can be performed against a pane in a window when configured via the keys and mouse configuration options. This method allows your lua script to trigger those actions for itself.
|
||||||
|
---@field restore fun(self: Window): nil Restores the window from the maximized state. See also: `window:maximize()`.
|
||||||
|
---@field set_config_overrides fun(self: Window, overrides: Config): nil Changes the set of configuration overrides for the window. The config file is re-evaluated and any CLI overrides are applied, followed by the keys and values from the overrides parameter. This can be used to override configuration on a per-window basis; this is only useful for options that apply to the GUI window, such as rendering the GUI. Each call to `window:set_config_overrides` will emit the `window-config-reloaded` event for the window. If you are calling this method from inside the handler for `window-config-reloaded` you should take care to only call `window:set_config_overrides` if the actual override values have changed to avoid a loop.
|
||||||
|
---@field set_inner_size fun(self: Window, width: number, height: number): nil Resizes the inner portion of the window (excluding any window decorations) to the specified width and height.
|
||||||
|
---@field set_left_status fun(self: Window, string: string): nil This method can be used to change the content that is displayed in the tab bar, to the left of the tabs. The content is displayed left-aligned and will take as much space as needed to display the content that you set; it will not be implicitly clipped. The parameter is a string that can contain escape sequences that change presentation. It is recommended that you use wezterm.format to compose the string.
|
||||||
|
---@field set_position fun(self: Window, x: number, y: number): nil Repositions the top-left corner of the window to the specified x, y coordinates. Note that Wayland does not allow applications to directly control their window placement, so this method has no effect on Wayland.
|
||||||
|
---@field set_right_status fun(self: Window, string: string): nil This method can be used to change the content that is displayed in the tab bar, to the right of the tabs and new tab button. The content is displayed right-aligned and will be clipped from the left edge to fit in the available space. The parameter is a string that can contain escape sequences that change presentation. It is recommended that you use wezterm.format to compose the string.
|
||||||
|
---@field toast_notification fun(self: Window, title: string, message: string, url: string?, timeout_milliseconds: number): nil Generates a desktop "toast notification" with the specified title and message. An optional url parameter can be provided; clicking on the notification will open that URL. An optional timeout parameter can be provided; if so, it specifies how long the notification will remain prominently displayed in milliseconds. To specify a timeout without specifying a url, set the url parameter to nil. The timeout you specify may not be respected by the system, particularly in X11/Wayland environments, and Windows will always use a fixed, unspecified, duration. The notification will persist on screen until dismissed or clicked, or until its timeout duration elapses.
|
||||||
|
---@field toggle_fullscreen fun(self: Window): nil Toggles full screen mode for the window.
|
||||||
|
---@field window_id fun(self: Window): number Returns the id number for the window. The Id is used to identify the window within the internal multiplexer and can be used when making API calls via wezterm cli to indicate the subject of manipulation.
|
8
.config/wezterm/types/objects/wsl-domain.lua
Executable file
8
.config/wezterm/types/objects/wsl-domain.lua
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class WslDomain
|
||||||
|
---@field name String
|
||||||
|
---@field distribution String
|
||||||
|
---@field username String
|
||||||
|
---@field default_cwd PathBuf
|
||||||
|
---@field default_prog String[]
|
51
.config/wezterm/types/wezterm/color/init.lua
Executable file
51
.config/wezterm/types/wezterm/color/init.lua
Executable file
|
@ -0,0 +1,51 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: finish
|
||||||
|
|
||||||
|
---@class ColorMod
|
||||||
|
---@field parse fun(color: string): Color?
|
||||||
|
local color = {}
|
||||||
|
|
||||||
|
---@param filename string
|
||||||
|
---@param params? { fuzziness: number, num_colors: number, max_width: number, max_height: number, min_brightness: number, max_brightness: number, threshold: number, min_contrast: number }
|
||||||
|
function color.extract_colors_from_image(filename, params) end
|
||||||
|
|
||||||
|
---@param h string | number
|
||||||
|
---@param s string | number
|
||||||
|
---@param l string | number
|
||||||
|
---@param a string | number
|
||||||
|
---@return ColorMod
|
||||||
|
function color.from_hsla(h, s, l, a) end
|
||||||
|
|
||||||
|
---@return table<string, Palette>
|
||||||
|
function color.get_builtin_schemes() end
|
||||||
|
|
||||||
|
---@return Palette
|
||||||
|
function color.get_default_colors() end
|
||||||
|
|
||||||
|
---@param gradient Gradient
|
||||||
|
---@param num_colors number
|
||||||
|
---@return Color[]
|
||||||
|
function color.gradient(gradient, num_colors) end
|
||||||
|
|
||||||
|
---@param file_name string
|
||||||
|
---@return Palette, ColorSchemeMetaData
|
||||||
|
function color.load_base16_scheme(file_name) end
|
||||||
|
|
||||||
|
---@param file_name string
|
||||||
|
---@return Palette, ColorSchemeMetaData
|
||||||
|
function color.load_scheme(file_name) end
|
||||||
|
|
||||||
|
---@param file_name string
|
||||||
|
---@return Palette, ColorSchemeMetaData
|
||||||
|
function color.load_terminal_sexy_scheme(file_name) end
|
||||||
|
|
||||||
|
---@param string string
|
||||||
|
---@return Color
|
||||||
|
-- Parses the passed color and returns a Color object. Color objects evaluate as strings but have a number of methods that allow transforming and comparing colors.
|
||||||
|
function color.parse(string) end
|
||||||
|
|
||||||
|
---@param colors Palette
|
||||||
|
---@param metadata ColorSchemeMetaData
|
||||||
|
---@param file_name string
|
||||||
|
function color.save_scheme(colors, metadata, file_name) end
|
12
.config/wezterm/types/wezterm/gui/init.lua
Executable file
12
.config/wezterm/types/wezterm/gui/init.lua
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: finish
|
||||||
|
|
||||||
|
---@class GuiMod
|
||||||
|
---@field default_key_tables any
|
||||||
|
---@field default_keys any
|
||||||
|
---@field enumerate_gpus any
|
||||||
|
---@field get_appearance any
|
||||||
|
---@field gui_window_for_mux_window any
|
||||||
|
---@field gui_windows any
|
||||||
|
---@field screens any
|
77
.config/wezterm/types/wezterm/init.lua
Executable file
77
.config/wezterm/types/wezterm/init.lua
Executable file
|
@ -0,0 +1,77 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: specify "any" types where possible
|
||||||
|
|
||||||
|
---@alias PathBuf string
|
||||||
|
|
||||||
|
---@class Wezterm :ExecDomain
|
||||||
|
---@field GLOBAL table<string, ANY>
|
||||||
|
---@field action Action
|
||||||
|
---@field add_to_config_reload_watch_list fun(path: string): nil Adds path to the list of files that are watched for config changes. If `automatically_reload_config` is enabled, then the config will be reloaded when any of the files that have been added to the watch list have changed.
|
||||||
|
---@field background_child_process fun(args: string[]): nil Accepts an argument list; it will attempt to spawn that command in the background.
|
||||||
|
---@field battery_info fun(): BatteryInfo[] Returns battery information for each of the installed batteries on the system. This is useful for example to assemble status information for the status bar.
|
||||||
|
---@field column_width fun(string): number Given a string parameter, returns the number of columns that that text occupies in the terminal, which is useful together with format-tab-title and update-right-status to compute/layout tabs and status information.
|
||||||
|
---@field config_builder fun(): Config Returns a config builder object that can be used to define your configuration.
|
||||||
|
---@field config_dir string This constant is set to the path to the directory in which your wezterm.lua configuration file was found.
|
||||||
|
---@field config_file string This constant is set to the path to the wezterm.lua that is in use.
|
||||||
|
---@field color ColorMod The `wezterm.color` module exposes functions that work with colors.
|
||||||
|
---@field default_hyperlink_rules fun(): HyperLinkRule[] Returns the compiled-in default values for hyperlink_rules.
|
||||||
|
---@field default_ssh_domains fun(): SSHDomainObj[] Computes a list of SshDomain objects based on the set of hosts discovered in your ~/.ssh/config. Each host will have both a plain SSH and a multiplexing SSH domain generated and returned in the list of domains. The former don't require wezterm to be installed on the remote host, while the latter do require it. The intended purpose of this function is to allow you the opportunity to edit/adjust the returned information before assigning it to your config.
|
||||||
|
---@field default_wsl_domains fun(): { name: string, distribution: string }[] Computes a list of WslDomain objects, each one representing an installed WSL distribution on your system. This list is the same as the default value for the wsl_domains configuration option, which is to make a WslDomain with the distribution field set to the name of WSL distro and the name field set to name of the distro but with "WSL:" prefixed to it.
|
||||||
|
---@field emit fun(event: string, ...)
|
||||||
|
---@field enumerate_ssh_hosts fun(ssh_config_file_name: string?): { [string] : { hostname: string, identityagent: string, identityfile: string, port: string, user: string, userknownhostsfile: string } } This function will parse your ssh configuration file(s) and extract from them the set of literal (non-pattern, non-negated) host names that are specified in Host and Match stanzas contained in those configuration files and return a mapping from the hostname to the effective ssh config options for that host. You may optionally pass a list of ssh configuration files that should be read, in case you have a special configuration.
|
||||||
|
---@field executable_dir string This constant is set to the directory containing the wezterm executable file.
|
||||||
|
---@field font (fun(font_attributes: FontAttributes): Fonts) | (fun(name: string, font_attributes?: FontAttributes?)): Fonts https://wezfurlong.org/wezterm/config/lua/wezterm/font.html
|
||||||
|
---@field font_with_fallback fun(fonts: string[] | FontAttributes[]): Fonts https://wezfurlong.org/wezterm/config/lua/wezterm/font_with_fallback.html
|
||||||
|
---@field format fun(...: FormatItem[]): string Can be used to produce a formatted string with terminal graphic attributes such as bold, italic and colors. The resultant string is rendered into a string with wezterm compatible escape sequences embedded.
|
||||||
|
---@field get_builtin_color_schemes any #TODO
|
||||||
|
---@field glob fun(pattern: string, relative_to: string?): string[] This function evalutes the glob pattern and returns an array containing the absolute file names of the matching results. Due to limitations in the lua bindings, all of the paths must be able to be represented as UTF-8 or this function will generate an error.
|
||||||
|
---@field gui GuiMod
|
||||||
|
---@field has_action fun(action: string): boolean
|
||||||
|
---@field mux MuxMod
|
||||||
|
---@field home_dir string This constant is set to the home directory of the user running wezterm.
|
||||||
|
---@field hostname fun(): string This function returns the current hostname of the system that is running wezterm. This can be useful to adjust configuration based on the host.
|
||||||
|
---@field json_encode fun(value: any): string Encodes the supplied lua value as json.
|
||||||
|
---@field json_parse fun(value: string): any Parses the supplied string as json and returns the equivalent lua values.
|
||||||
|
---@field log_error fun(msg: string, ...: any): nil Logs the provided message string through wezterm's logging layer at 'ERROR' level. If you started wezterm from a terminal that text will print to the stdout of that terminal. If running as a daemon for the multiplexer server then it will be logged to the daemon output path.
|
||||||
|
---@field log_info fun(msg: string, ...: any): nil Logs the provided message string through wezterm's logging layer at 'INFO' level. If you started wezterm from a terminal that text will print to the stdout of that terminal. If running as a daemon for the multiplexer server then it will be logged to the daemon output path.
|
||||||
|
---@field log_warn fun(msg: string, ...: any): nil Logs the provided message string through wezterm's logging layer at 'WARN' level. If you started wezterm from a terminal that text will print to the stdout of that terminal. If running as a daemon for the multiplexer server then it will be logged to the daemon output path.
|
||||||
|
---@field nerdfonts NerdFont
|
||||||
|
---@field open_with fun(path_or_url: string, application: string?) This function opens the specified path_or_url with either the specified application or uses the default application if application was not passed in.
|
||||||
|
---@field on EventAugmentCommandPalette | EventBell | EventFormatTabTitle | EventFormatWindowTitle | EventNewTabButtonClick | EventOpenUri | EventUpdateRightStatus | EventUpdateStatus | EventUserVarChanged | EventWindowConfigReloaded | EventWindowFocusChanged | EventWindowResized | EventCustom
|
||||||
|
---@field pad_left fun(string: string, min_width: integer): string Returns a copy of string that is at least min_width columns (as measured by wezterm.column_width)
|
||||||
|
---@field pad_right fun(string: string, min_width: integer): string Returns a copy of string that is at least min_width columns (as measured by wezterm.column_width).
|
||||||
|
---@field permute_any_or_no_mods any #TODO
|
||||||
|
---@field plugin WeztermPlugin
|
||||||
|
---@field read_dir fun(path: string): string Returns an array containing the absolute file names of the directory specified. Due to limitations in the lua bindings, all of the paths must be able to be represented as UTF-8 or this function will generate an error.
|
||||||
|
---@field reload_configuration fun(): nil Immediately causes the configuration to be reloaded and re-applied.
|
||||||
|
---@field run_child_process fun(args: string[]): { success: boolean, stdout: string, stderr: string } Will attempt to spawn that command and will return a tuple consisting of the boolean success of the invocation, the stdout data and the stderr data.
|
||||||
|
---@field running_under_wsl fun(): boolean Returns a boolean indicating whether we believe that we are running in a Windows Services for Linux (WSL) container.
|
||||||
|
---@field shell_join_args fun(args: string[]): string Joins together its array arguments by applying posix style shell quoting on each argument and then adding a space.
|
||||||
|
---@field shell_quote_arg fun(string: string): string Quotes its single argument using posix shell quoting rules.
|
||||||
|
---@field shell_split fun(line: string): string[] Splits a command line into an argument array according to posix shell rules.
|
||||||
|
---@field sleep_ms fun(milliseconds: number): nil wezterm.sleep_ms suspends execution of the script for the specified number of milliseconds. After that time period has elapsed, the script continues running at the next statement.
|
||||||
|
---@field split_by_newlines fun(string: string): string[] takes the input string and splits it by newlines (both \n and \r\n are recognized as newlines) and returns the result as an array of strings that have the newlines removed.
|
||||||
|
---@field strftime fun(format: string): string Formats the current local date/time into a string using the Rust chrono strftime syntax.
|
||||||
|
---@field strftime_utc fun(format: string): string Formats the current UTC date/time into a string using the Rust chrono strftime syntax.
|
||||||
|
---@field target_triple string This constant is set to the Rust target triple for the platform on which wezterm was built. This can be useful when you wish to conditionally adjust your configuration based on the platform.
|
||||||
|
---@field time TimeMod
|
||||||
|
---@field truncate_left fun(string: string, max_width: number): string Returns a copy of string that is no longer than max_width columns (as measured by wezterm.column_width). Truncation occurs by reemoving excess characters from the left end of the string.
|
||||||
|
---@field truncate_right fun(string: string, max_width: number): string Returns a copy of string that is no longer than max_width columns (as measured by wezterm.column_width). Truncation occurs by reemoving excess characters from the right end of the string.
|
||||||
|
---@field utf16_to_utf8 fun(string: string): string Overly specific and exists primarily to workaround this wsl.exe issue. It takes as input a string and attempts to convert it from utf16 to utf8.
|
||||||
|
---@field version string This constant is set to the wezterm version string that is also reported by running wezterm -V. This can potentially be used to adjust configuration according to the installed version.
|
||||||
|
Wezterm = {}
|
||||||
|
|
||||||
|
---@param table MouseBindingBase
|
||||||
|
---@return MouseBinding
|
||||||
|
---@overload fun(table: KeyBindingBase): KeyBinding
|
||||||
|
Wezterm.permute_any_mods = function(table) end
|
||||||
|
|
||||||
|
---@param gradient Gradient
|
||||||
|
---@param num_colors number
|
||||||
|
---@return Color[]
|
||||||
|
Wezterm.gradient_colors = function(gradient, num_colors) end
|
||||||
|
|
||||||
|
---@param callback ActionCallback
|
||||||
|
---@return Action
|
||||||
|
Wezterm.action_callback = function(callback) end
|
15
.config/wezterm/types/wezterm/mux/init.lua
Executable file
15
.config/wezterm/types/wezterm/mux/init.lua
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
---@class MuxMod
|
||||||
|
---@field all_domains fun(): MuxDomainObj[] Returns an array table holding all of the known MuxDomain objects.
|
||||||
|
---@field all_windows fun(): MuxWindow[] Returns an array table holding all of the known MuxWindow objects.
|
||||||
|
---@field get_active_workspace fun(): string Returns the name of the active workspace.
|
||||||
|
---@field get_domain fun(name_or_id: string | number): string Resolves name_or_id to a domain and returns a MuxDomain object representation of it. `name_or_id` can be: A domain name string to resolve the domain by name, A domain id to resolve the domain by id, nil or omitted to return the current default domain, other lua types will generate a lua error
|
||||||
|
---@field get_pane fun(id: number): Pane Given a pane ID, verifies that the ID is a valid pane known to the mux and returns a Pane object that can be used to operate on the pane. This is useful for situations where you have obtained a pane id from some other source and want to use the various `Pane` methods with it.
|
||||||
|
---@field get_tab fun(id: number): MuxTabObj Given a tab ID, verifies that the ID is a valid tab known to the mux and returns a MuxTab object that can be used to operate on the tab. This is useful for situations where you have obtained a tab id from some other source and want to use the various `MuxTab` methods with it.
|
||||||
|
---@field get_window fun(id: number): MuxWindow Given a window ID, verifies that the ID is a valid window known to the mux and returns a MuxWindow object that can be used to operate on the window. This is useful for situations where you have obtained a window id from some other source and want to use the various `MuxWindow` methods with it.
|
||||||
|
---@field get_workspace_names fun(): string[] Returns a table containing the names of the workspaces known to the mux.
|
||||||
|
---@field rename_workspace fun(old: string, new: string): nil Renames the workspace old to new.
|
||||||
|
---@field set_active_workspace fun(name: string): nil Sets the active workspace name. If the requested name doesn't correspond to an existing workspace, then an error is raised.
|
||||||
|
---@field set_default_domain fun(domain: MuxDomainObj): nil Assign a new default domain in the mux. The domain that you assign here will override any configured `default_domain` or the implicit assignment of the default domain that may have happened as a result of starting wezterm via `wezterm connect` or `wezterm serial`.
|
||||||
|
---@field spawn_window fun(...: any): {tab: MuxTabObj, pane: Pane, window: MuxWindow} Spawns a program into a new window, returning the MuxTab, Pane and MuxWindow objects associated with it. When no arguments are passed, the default program is spawned. TODO
|
9141
.config/wezterm/types/wezterm/nerdfonts.lua
Executable file
9141
.config/wezterm/types/wezterm/nerdfonts.lua
Executable file
File diff suppressed because it is too large
Load diff
9
.config/wezterm/types/wezterm/procinfo/init.lua
Executable file
9
.config/wezterm/types/wezterm/procinfo/init.lua
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: finish
|
||||||
|
|
||||||
|
---@class ProcInfoMod
|
||||||
|
---@field current_working_dir_for_pid any
|
||||||
|
---@field executable_path_for_pid any
|
||||||
|
---@field get_info_for_pid any
|
||||||
|
---@field pid any
|
9
.config/wezterm/types/wezterm/time/init.lua
Executable file
9
.config/wezterm/types/wezterm/time/init.lua
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
---@meta
|
||||||
|
|
||||||
|
--TODO: finish
|
||||||
|
|
||||||
|
---@class TimeMod
|
||||||
|
---@field call_after fun(interval: number, function: function): nil Arranges to call your callback function after the specified number of seconds have elapsed.
|
||||||
|
---@field now fun(): TimeObj Returns a WezTermTimeObj object representing the time at which wezterm.time.now() was called.
|
||||||
|
---@field parse fun(string): TimeObj Parses a string that is formatted according to the supplied format string.
|
||||||
|
---@field parse_rfc3339 fun(string): TimeObj Parses a string that is formatted according to RFC 3339 and returns a Time object representing that time.
|
|
@ -1,4 +1,5 @@
|
||||||
local wezterm = require("wezterm")
|
local wezterm = require("wezterm") --[[@as Wezterm]]
|
||||||
|
local act = wezterm.action
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
@ -11,8 +12,8 @@ M.merge_tables = function(a, b)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Only load color schemes once; store them for later use
|
||||||
M.get_schemes = function()
|
M.get_schemes = function()
|
||||||
-- Only load color schemes once; store them for later use
|
|
||||||
local schemes = wezterm.GLOBAL.color_schemes
|
local schemes = wezterm.GLOBAL.color_schemes
|
||||||
if schemes then
|
if schemes then
|
||||||
return schemes
|
return schemes
|
||||||
|
@ -21,4 +22,34 @@ M.get_schemes = function()
|
||||||
return wezterm.GLOBAL.color_schemes
|
return wezterm.GLOBAL.color_schemes
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Mimicks the show_last_command_output command in Kitty
|
||||||
|
-- Spawns the pager in a new tab since Wezterm (for now) lacks overlays
|
||||||
|
-- This function is meant to be used as a keybinding callback
|
||||||
|
M.open_last_output_in_less = function(window, pane)
|
||||||
|
-- Grab the last nonempty "output" semantic zone
|
||||||
|
local zones = pane:get_semantic_zones("Output")
|
||||||
|
local last_output = ""
|
||||||
|
local idx = #zones
|
||||||
|
while true do
|
||||||
|
if idx == 0 then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
last_output = pane:get_text_from_semantic_zone(zones[idx])
|
||||||
|
if last_output ~= "" then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
idx = idx - 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Ensure any quotes in output are properly escaped
|
||||||
|
-- This is because we need to use sh/echo as a hackaround for wezterm not supporting passing stdin to
|
||||||
|
-- commands spawned in a new tab/window
|
||||||
|
-- See this StackOverflow question/answer for why this particular substitution works: https://stackoverflow.com/a/1315213
|
||||||
|
last_output = last_output:gsub("'", "'\\''")
|
||||||
|
|
||||||
|
-- Spawn less in a new tab
|
||||||
|
local action = act.SpawnCommandInNewTab({ args = { "sh", "-c", "echo '" .. last_output .. "' | less -R" } })
|
||||||
|
window:perform_action(action, pane)
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue