Skip to content

Commit 5ef2f41

Browse files
authored
Merge pull request #65 from DrKJeff16/patch/documentation
2 parents 92fbf2a + c551815 commit 5ef2f41

7 files changed

Lines changed: 616 additions & 617 deletions

File tree

lua/wezterm/types/config.lua

Lines changed: 20 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@
1010
---|"Center"
1111
---|"Right"
1212

13-
---@alias VerticalAlign
14-
---|"Top"
15-
---|"Center"
16-
---|"Bottom"
17-
1813
---@class ContentAlignment
1914
---@field horizontal HorizontalAlign
20-
---@field vertical VerticalAlign
15+
---@field vertical "Top"|"Center"|"Bottom"
2116

2217
---@alias DroppedFileQuoting
2318
---|"None"
@@ -26,10 +21,6 @@
2621
---|"Windows"
2722
---|"WindowsAlwaysQuoted"
2823

29-
---@alias ImePreeditRendering
30-
---|"Builtin"
31-
---|"System"
32-
3324
---@alias DefaultCursorStyle
3425
---|"SteadyBlock"
3526
---|"BlinkingBlock"
@@ -56,10 +47,6 @@
5647
---@field top? integer|string
5748
---@field bottom? integer|string
5849

59-
---@alias WindowCloseConfirmation
60-
---|"AlwaysPrompt"
61-
---|"NeverPrompt"
62-
6350
---@class DaemonOptions
6451
---@field stdout? string
6552
---@field stderr? string
@@ -72,14 +59,6 @@
7259
---@field fade_out_function? EasingFunction
7360
---@field target? "BackgroundColor"|"CursorColor"
7461

75-
---@class BackgroundLayer.Source1
76-
---@field File string
77-
---@field speed? number
78-
79-
---@class BackgroundLayer.Source2
80-
---@field Gradient Gradient
81-
---@field Color string
82-
8362
---@alias BackgroundLayerRepeat
8463
---|"Repeat"
8564
---|"Mirror"
@@ -103,7 +82,7 @@
10382
---@class BackgroundLayer
10483
---Defines the source of the layer texture data.
10584
---
106-
---@field source? BackgroundLayer.Source1|BackgroundLayer.Source2
85+
---@field source? { File: string, speed: number? }|{ Gradient: Gradient, Color: string }
10786
---Controls whether the layer is fixed to the viewport or moves as it scrolls:
10887
---
10988
--- - `"Fixed"`: (default) to not move as the window scrolls
@@ -172,7 +151,7 @@
172151
---A _hue, saturation, brightness_ transformation that can be used to adjust
173152
---those attributes of the layer.
174153
---
175-
---See `foreground_text_hsb` for more information about this kind of transform.
154+
---See `config.foreground_text_hsb` for more information about this kind of transform.
176155
---
177156
---@field hsb? HsbTransform
178157
---Controls the height of the image. The following values are accepted:
@@ -201,10 +180,6 @@
201180
---|"CarriageReturn"
202181
---|"CarriageReturnAndLineFeed"
203182

204-
---@alias KeyMapPreference
205-
---|"Mapped"
206-
---|"Physical"
207-
208183
---@alias UIKeyCapRendering
209184
---|"UnixLong" `Super`, `Meta`, `Ctrl`, `Shift`
210185
---|"Emacs" `Super`, `M`, `C`, `S`
@@ -271,7 +246,7 @@
271246
---Subsequent layers are composited over the top of preceding layers.
272247
---
273248
---@field background? BackgroundLayer[]
274-
---@field bold_brightens_ansi_colors? BoldBrightening
249+
---@field bold_brightens_ansi_colors? "No"|"BrightAndBold"|"BrightOnly"
275250
---If an application has enabled mouse reporting mode, mouse events are sent directly
276251
---to the application, and do not get routed through the mouse assignment logic.
277252
---
@@ -566,22 +541,22 @@
566541
---@field disable_default_key_bindings? boolean
567542
---@field disable_default_mouse_bindings? boolean
568543
---@field disable_default_quick_select_patterns? boolean
569-
---@field display_pixel_geometry? DisplayPixelGeometry
544+
---@field display_pixel_geometry? "RGB"|"BGR"
570545
---Override the detected DPI (dots per inch) for the display.
571546
---
572547
---This can be useful if the detected DPI is inaccurate and the text
573548
---appears either blurry or too small
574549
---(particularly if you are using a 4K display on X11 or Wayland).
575550
---
576551
---The default value is system specific:
577-
--
552+
---
578553
-- | OS | Standard Density | High Density |
579554
-- |---------|-------------------------|-------------------------|
580555
-- | macOS | `72.0` | `144.0` |
581556
-- | Windows | Probed from the display | Probed from the display |
582557
-- | X11 | `96.0` | `96.0` |
583558
-- | Wayland | `96.0` | `192.0` |
584-
--
559+
---
585560
---In macOS and Wayland environments there isn't strictly a system DPI value that can be queried;
586561
---instead standard density has a fixed value and the system will inform WezTerm
587562
---when the display is high density by communicating a scaling factor for the display.
@@ -650,8 +625,8 @@
650625
---
651626
---@field enable_wayland? boolean
652627
---@field exec_domains? ExecDomain[]
653-
---@field exit_behavior? ExitBehavior
654-
---@field exit_behavior_messaging? ExitBehaviorMessaging
628+
---@field exit_behavior? "Close"|"CloseOnCleanExit"|"Hold"
629+
---@field exit_behavior_messaging? "Verbose"|"Brief"|"Terse"|"None"
655630
---Configures the font to use by default.
656631
---
657632
---The font setting can specify a set of fallbacks and other options,
@@ -665,7 +640,7 @@
665640
---@field font_dirs? string[]
666641
---DEPRECATED
667642
---@field font_hinting? Deprecated
668-
---@field font_locator? FontLocatorSelection
643+
---@field font_locator? "FontConfig"|"Gdi"|"CoreText"|"ConfigDirsOnly"
669644
---@field font_rasterizer? "FreeType"
670645
---When textual output in the terminal is styled with `bold`, `italic`
671646
---or other attributes, wezterm uses `config.font_rules`
@@ -699,10 +674,9 @@
699674
---
700675
---The shaper is responsible for handling kerning, ligatures and emoji composition.
701676
---
677+
---The only option is `"Harfbuzz"`.
702678
---The incomplete `"Allsorts"` shaper was removed.
703679
---
704-
---The default is `"Harfbuzz"`.
705-
---
706680
---@field font_shaper? "Harfbuzz"
707681
---@field font_size? number
708682
---When `config.force_reverse_video_cursor = true`, override the
@@ -724,7 +698,7 @@
724698
---that is applied to monochrome glyphs.
725699
---
726700
---The transform works by converting the `RGB` colors to `HSV` values
727-
---and then multiplying the HSV by the numbers specified in `foreground_text_hsb`.
701+
---and then multiplying the HSV by the numbers specified in `config.foreground_text_hsb`.
728702
---
729703
---Modifying the hue changes the hue of the color by rotating it through the color wheel.
730704
---It is not as useful as the other components, but is available "for free"
@@ -748,6 +722,8 @@
748722
---}
749723
---```
750724
---
725+
---See [`HsbTransform`](lua://HsbTransform) for more details.
726+
---
751727
---@field foreground_text_hsb? HsbTransform
752728
---Selects the freetype interpret version to use.
753729
---
@@ -791,7 +767,7 @@
791767
--- - Vulkan
792768
--- - DirectX 12 (on Windows)
793769
---
794-
---@field front_end? FrontEndSelection
770+
---@field front_end? "OpenGL"|"WebGpu"|"Software"
795771
---@field glyph_cache_image_cache_size? number
796772
---When `config.font_shaper = "Harfbuzz"`, this setting affects how font shaping takes place.
797773
---
@@ -817,7 +793,7 @@
817793
---Defines rules to match text from the terminal output and generate clickable links.
818794
---
819795
---@field hyperlink_rules? HyperlinkRule[]
820-
---@field ime_preedit_rendering? ImePreeditRendering
796+
---@field ime_preedit_rendering? "Builtin"|"System"
821797
---Specifies the width of a new window, expressed in character cells.
822798
---
823799
---@field initial_cols? integer
@@ -843,7 +819,7 @@
843819
---
844820
---Default key assignments also respect `config.key_map_preference`.
845821
---
846-
---@field key_map_preference? KeyMapPreference
822+
---@field key_map_preference? "Mapped"|"Physical"
847823
---See the main [Key Tables docs](https://wezterm.org/config/key-tables.html).
848824
---
849825
---@field key_tables? table<string, Key[]>
@@ -1140,7 +1116,7 @@
11401116
---@field show_update_window? boolean
11411117
---@field skip_close_confirmation_for_processes_named? string[]
11421118
---@field sort_fallback_fonts_by_coverage? boolean
1143-
---@field ssh_backend? SshBackend
1119+
---@field ssh_backend? "Ssh2"|"LibSsh"
11441120
---@field ssh_domains? SshDomain[]
11451121
---@field status_update_interval? integer
11461122
---@field strikethrough_position? string|number
@@ -1276,7 +1252,7 @@
12761252
---
12771253
---Defaults to `"LowPower"`.
12781254
---
1279-
---@field webgpu_power_preference? WebGpuPowerPreference
1255+
---@field webgpu_power_preference? "LowPower"|"HighPerformance"
12801256
---Specifies which WebGpu adapter should be used.
12811257
---
12821258
---This option is only applicable when you have configured `config.front_end = "WebGpu"`.
@@ -1333,7 +1309,7 @@
13331309
---performance.
13341310
---
13351311
---@field window_background_opacity? number
1336-
---@field window_close_confirmation? WindowCloseConfirmation
1312+
---@field window_close_confirmation? "AlwaysPrompt"|"NeverPrompt"
13371313
---Controls the alignment of the terminal cells inside the window.
13381314
---
13391315
---When window size is not a multiple of terminal cell size,
Lines changed: 12 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,15 @@
11
---@meta
22

3-
---The `"augment-command-palette"` event is emitted when
4-
---the `Command Palette` is shown.
5-
---
6-
---Its purpose is to enable you to add additional entries
7-
---to the list of commands shown in the palette.
8-
---
9-
---This hook is synchronous; calling asynchronous functions will not succeed.
10-
---
11-
---The return value is a `AugmentCommandPaletteReturn` table
12-
---@see AugmentCommandPaletteReturn
13-
---@alias AugmentCommandPalette "augment-command-palette"
14-
15-
---The `"bell"` event is emitted when the `ASCII BEL` sequence
16-
---is emitted to a pane in the window.
17-
---
18-
---Defining an event handler doesn't alter wezterm's handling of the bell;
19-
---the event supplements it and allows you
20-
---to take additional action over the configured behavior.
21-
---@see Event.Bell
22-
---@alias Bell "bell"
23-
24-
---The `"format-tab-title"` event is emitted when the text for a tab title
25-
---needs to be recomputed.
26-
---
27-
---This event is a bit special in that it is synchronous and must return
28-
---as quickly as possible in order to avoid blocking the GUI thread.
29-
---
30-
---The most notable consequence of this is that some functions that are asynchronous
31-
---(e.g. `wezterm.run_child_process()`) are not possible to call
32-
---from inside the event handler and will generate a
33-
---`format-tab-title: runtime error: attempt to yield from outside a coroutine` error
34-
---@alias FormatTabTitle "format-tab-title"
35-
36-
---The `"format-window-title"` event is emitted when the text for the window title
37-
---needs to be recomputed.
38-
---
39-
---This event is a bit special in that it is synchronous and must return
40-
---as quickly as possible in order to avoid blocking the GUI thread.
41-
---
42-
---The most notable consequence of this is that some functions that are asynchronous
43-
---(e.g. `wezterm.run_child_process()`) are not possible to call
44-
---from inside the event handler and will generate a
45-
---`format-window-title: runtime error: attempt to yield from outside a coroutine` error
46-
---@alias FormatWindowTitle "format-window-title"
47-
48-
---The `"new-tab-button-click"` event is emitted when the user clicks on the
49-
---`"new tab"` button in the tab bar.
50-
---
51-
---This is the `+` button that is drawn to the right of the last tab
52-
---@alias NewTabButtonClick "new-tab-button-click"
53-
54-
---The `"open-uri"` event is emitted when
55-
---the `CompleteSelectionOrOpenLinkAtMouseCursor` key/mouse assignment is triggered.
56-
---
57-
---The default action is to open the active URI in your browser,
58-
---but if you register for this event you can co-opt the default behavior
59-
---@alias OpenUri "open-uri"
60-
61-
---## WARNING
62-
---
63-
---This event is considered to be deprecated and you should migrate to using `"update-status"`,
64-
---which behaves the same way, but doesn't overly focus on the right status area.
65-
---
66-
--- ---
67-
---
68-
---The `"update-right-status"` event is emitted periodically
69-
---(based on the interval specified by the status_update_interval configuration value)
70-
---@deprecated
71-
---@alias UpdateRightStatus "update-right-status"
72-
73-
---The `"update-status"` event is emitted periodically
74-
---(based on the interval specified by the status_update_interval configuration value)
75-
---@alias UpdateStatus "update-status"
76-
77-
---The `"user-var-changed"` event is emitted when a _user var escape sequence_
78-
---is used to set a user var
79-
---@alias UserVarChanged "user-var-changed"
80-
81-
---The `"window-config-reloaded"` event is emitted when the configuration for
82-
---a window has been reloaded.
83-
---
84-
---This can occur when the configuration file is detected as changed
85-
---(when `Config.automatically_reload_config` is enabled),
86-
---when the configuration is explicitly reloaded via the `ReloadConfiguration` key action,
87-
---and when `Window:set_config_overrides()` is called for the window
88-
---@alias WindowConfigReloaded "window-config-reloaded"
89-
90-
---The `"window-focus-changed"` event is emitted when the focus state for a window is changed
91-
---@alias WindowFocusChanged "window-focus-changed"
92-
---The `"window-resized"` event is emitted when the window is resized
93-
---and when transitioning between full-screen and regular windowed mode.
94-
---
95-
---The event is triggered asynchronously with respect to the potentially-ongoing
96-
---live resize operation. `wezterm` will coalesce the stream of multiple events
97-
---generated by a live resize such that there can be
98-
---a maximum of 1 event executing and 1 event buffered.
99-
---@alias WindowResized "window-resized"
100-
1013
---@alias WindowEvent
102-
---|AugmentCommandPalette
103-
---|Bell
104-
---|FormatTabTitle
105-
---|FormatWindowTitle
106-
---|NewTabButtonClick
107-
---|OpenUri
108-
---|UpdateRightStatus -- DEPRECATED
109-
---|UpdateStatus
110-
---|UserVarChanged
111-
---|WindowConfigReloaded
112-
---|WindowFocusChanged
113-
---|WindowResized
4+
---|"augment-command-palette"
5+
---|"bell"
6+
---|"format-tab-title"
7+
---|"format-window-title"
8+
---|"new-tab-button-click"
9+
---|"open-uri"
10+
---|"update-right-status" -- DEPRECATED
11+
---|"update-status"
12+
---|"user-var-changed"
13+
---|"window-config-reloaded"
14+
---|"window-focus-changed"
15+
---|"window-resized"

lua/wezterm/types/objects/window.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
---This is the same text that is shown at the cursor position when composing
4141
---@field composition_status fun(self: Window): string|nil
4242
---Puts text into the specified clipboard
43-
---@field copy_to_clipboard fun(self: Window, text: string, target: CopyToTarget?)
43+
---@field copy_to_clipboard fun(self: Window, text: string, target?: "Clipboard"|"PrimarySelection"|"ClipboardAndPrimarySelection")
4444
---Returns the current event. For now only implemented for mouse events
4545
---@field current_event fun(self: Window): WindowEvent
4646
---Returns a Lua table representing the effective configuration for the `Window`.

0 commit comments

Comments
 (0)