forked from DrKJeff16/wezterm-types
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwezterm.lua
More file actions
2332 lines (2170 loc) · 74.6 KB
/
Copy pathwezterm.lua
File metadata and controls
2332 lines (2170 loc) · 74.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---@meta wezterm
---@diagnostic disable:unused-local
---@module "wezterm.types.config"
---@module "wezterm.types.events"
---@module "wezterm.types.harfbuzz"
---@module "wezterm.types.wezterm.color"
---@module "wezterm.types.wezterm.gui"
---@module "wezterm.types.wezterm.mux"
---@module "wezterm.types.wezterm.nerdfonts"
---@module "wezterm.types.wezterm.plugin"
---@module "wezterm.types.wezterm.procinfo"
---@module "wezterm.types.wezterm.serde"
---@module "wezterm.types.wezterm.time"
---@module "wezterm.types.wezterm.url"
---@module "wezterm.types.plugins.agent-deck"
---@module "wezterm.types.plugins.ai-commander"
---@module "wezterm.types.plugins.ai-helper"
---@module "wezterm.types.plugins.bar"
---@module "wezterm.types.plugins.battery"
---@module "wezterm.types.plugins.cmd-sender"
---@module "wezterm.types.plugins.dev"
---@module "wezterm.types.plugins.lib"
---@module "wezterm.types.plugins.listeners"
---@module "wezterm.types.plugins.modal"
---@module "wezterm.types.plugins.pinned-tabs"
---@module "wezterm.types.plugins.pivot-panes"
---@module "wezterm.types.plugins.presentation"
---@module "wezterm.types.plugins.quick-domains"
---@module "wezterm.types.plugins.quickselect"
---@module "wezterm.types.plugins.replay"
---@module "wezterm.types.plugins.resurrect"
---@module "wezterm.types.plugins.rosepine"
---@module "wezterm.types.plugins.sessionizer"
---@module "wezterm.types.plugins.smart-splits"
---@module "wezterm.types.plugins.smart-workspace-switcher"
---@module "wezterm.types.plugins.stack"
---@module "wezterm.types.plugins.tabline"
---@module "wezterm.types.plugins.tabsets"
---@module "wezterm.types.plugins.toggle-terminal"
---@module "wezterm.types.plugins.wez-pain-control"
---@module "wezterm.types.plugins.wezterm-config"
---@module "wezterm.types.plugins.wezterm-status"
---@module "wezterm.types.plugins.wezterm-tabs"
---@module "wezterm.types.plugins.wezterm-theme-rotator"
---@module "wezterm.types.plugins.wez-tmux"
---@module "wezterm.types.plugins.workspace-picker"
---@module "wezterm.types.plugins.workspacesionizer"
---@module "wezterm.types.plugins.wsinit"
---@alias ColorSpec { AnsiColor: AnsiColor }|{ Color: string }
---@enum (key) FormatItemAttribute.Underline
local format_item_underline = {
Curly = 1,
Dashed = 1,
Dotted = 1,
Double = 1,
None = 1,
Single = 1,
}
---@enum (key) FormatItemAttribute.Intensity
local format_item_intensity = {
Bold = 1,
Half = 1,
Normal = 1,
}
---@class FormatItemAttribute
---@field Intensity? FormatItemAttribute.Intensity
---@field Italic? boolean
---@field Underline FormatItemAttribute.Underline
---@class FormatItemSpec
---@field Attribute? FormatItemAttribute
---@field Background? ColorSpec
---@field Foreground? ColorSpec
---@field Text? string
---@alias FormatItem "ResetAttributes"|FormatItemSpec
---This is a virtual modifier used by wezterm
---@enum (key) Modifiers
local modifiers = {
ALT = 1,
CTRL = 1,
ENHANCED_KEY = 1,
LEADER = 1,
LEFT_ALT = 1,
LEFT_CTRL = 1,
LEFT_SHIFT = 1,
NONE = 1,
RIGHT_ALT = 1,
RIGHT_CTRL = 1,
RIGHT_SHIFT = 1,
SHIFT = 1,
SUPER = 1,
}
---Configures whether the window has a title bar and/or resizable border.
---
---The value is a set of flags:
---
--- - `"NONE"`: Disables titlebar and border (borderless mode),
--- but causes problems with resizing and minimizing the window,
--- so you probably want to use `"RESIZE"` instead of `"NONE"`
--- if you just want to remove the title bar
--- - `"TITLE"`: Disable the resizable border and enable only the title bar
--- - `"RESIZE"`: Disable the title bar but enable the resizable border
--- - `"TITLE|RESIZE"`: Enable titlebar and border.
--- This is the default
--- - `"INTEGRATED_BUTTONS|RESIZE"`: Place window management buttons (minimize, maximize, close)
--- into the tab bar instead of showing a title bar
--- - `"MACOS_FORCE_DISABLE_SHADOW"`: (macOS only) disable the window shadow effect
--- - `"MACOS_FORCE_ENABLE_SHADOW"`: (macOS only) enable the window shadow effect
--- - `"MACOS_FORCE_SQUARE_CORNERS"`: (macOS only) force the window to have square
--- rather than rounded corners.
--- It is not compatible with `"TITLE"` or `"INTEGRATED_BUTTONS"`
--- - `"MACOS_USE_BACKGROUND_COLOR_AS_TITLEBAR_COLOR"`: (macOS only) change the system titlebar background color
--- to match the terminal background color defined
--- by your configuration.
--- This option doesn't make sense to use without
--- also including `"TITLE|RESIZE"` in the set of decorations
---
---@enum (key) WindowDecorations
local window_decorations = {
INTEGRATED_BUTTONS = 1,
MACOS_FORCE_DISABLE_SHADOW = 1,
MACOS_FORCE_ENABLE_SHADOW = 1,
MACOS_FORCE_SQUARE_CORNERS = 1,
NONE = 1,
RESIZE = 1,
TITLE = 1,
["INTEGRATED_BUTTONS|RESIZE"] = 1,
["MACOS_FORCE_DISABLE_SHADOW|TITLE"] = 1,
["MACOS_FORCE_ENABLE_SHADOW|TITLE"] = 1,
["RESIZE|INTEGRATED_BUTTONS"] = 1,
["RESIZE|TITLE"] = 1,
["TITLE|MACOS_FORCE_DISABLE_SHADOW"] = 1,
["TITLE|MACOS_FORCE_ENABLE_SHADOW"] = 1,
["TITLE|RESIZE"] = 1,
["INTEGRATED_BUTTONS|MACOS_FORCE_DISABLE_SHADOW|RESIZE"] = 1,
["INTEGRATED_BUTTONS|MACOS_FORCE_ENABLE_SHADOW|RESIZE"] = 1,
["INTEGRATED_BUTTONS|RESIZE|MACOS_FORCE_DISABLE_SHADOW"] = 1,
["INTEGRATED_BUTTONS|RESIZE|MACOS_FORCE_ENABLE_SHADOW"] = 1,
["MACOS_FORCE_DISABLE_SHADOW|INTEGRATED_BUTTONS|RESIZE"] = 1,
["MACOS_FORCE_DISABLE_SHADOW|RESIZE"] = 1,
["MACOS_FORCE_DISABLE_SHADOW|RESIZE|INTEGRATED_BUTTONS"] = 1,
["MACOS_FORCE_DISABLE_SHADOW|RESIZE|TITLE"] = 1,
["MACOS_FORCE_DISABLE_SHADOW|TITLE|RESIZE"] = 1,
["MACOS_FORCE_ENABLE_SHADOW|INTEGRATED_BUTTONS|RESIZE"] = 1,
["MACOS_FORCE_ENABLE_SHADOW|RESIZE"] = 1,
["MACOS_FORCE_ENABLE_SHADOW|RESIZE|INTEGRATED_BUTTONS"] = 1,
["MACOS_FORCE_ENABLE_SHADOW|RESIZE|TITLE"] = 1,
["MACOS_FORCE_ENABLE_SHADOW|TITLE|RESIZE"] = 1,
["MACOS_FORCE_SQUARE_CORNERS|RESIZE"] = 1,
["MACOS_USE_BACKGROUND_COLOR_AS_TITLEBAR_COLOR|RESIZE|TITLE"] = 1,
["MACOS_USE_BACKGROUND_COLOR_AS_TITLEBAR_COLOR|TITLE|RESIZE"] = 1,
["RESIZE|INTEGRATED_BUTTONS|MACOS_FORCE_DISABLE_SHADOW"] = 1,
["RESIZE|INTEGRATED_BUTTONS|MACOS_FORCE_ENABLE_SHADOW"] = 1,
["RESIZE|MACOS_FORCE_DISABLE_SHADOW"] = 1,
["RESIZE|MACOS_FORCE_DISABLE_SHADOW|INTEGRATED_BUTTONS"] = 1,
["RESIZE|MACOS_FORCE_DISABLE_SHADOW|TITLE"] = 1,
["RESIZE|MACOS_FORCE_ENABLE_SHADOW"] = 1,
["RESIZE|MACOS_FORCE_ENABLE_SHADOW|INTEGRATED_BUTTONS"] = 1,
["RESIZE|MACOS_FORCE_ENABLE_SHADOW|TITLE"] = 1,
["RESIZE|MACOS_FORCE_SQUARE_CORNERS"] = 1,
["RESIZE|MACOS_USE_BACKGROUND_COLOR_AS_TITLEBAR_COLOR|TITLE"] = 1,
["RESIZE|TITLE|MACOS_FORCE_DISABLE_SHADOW"] = 1,
["RESIZE|TITLE|MACOS_FORCE_ENABLE_SHADOW"] = 1,
["RESIZE|TITLE|MACOS_USE_BACKGROUND_COLOR_AS_TITLEBAR_COLOR"] = 1,
["TITLE|MACOS_FORCE_DISABLE_SHADOW|RESIZE"] = 1,
["TITLE|MACOS_FORCE_ENABLE_SHADOW|RESIZE"] = 1,
["TITLE|MACOS_USE_BACKGROUND_COLOR_AS_TITLEBAR_COLOR|RESIZE"] = 1,
["TITLE|RESIZE|MACOS_FORCE_DISABLE_SHADOW"] = 1,
["TITLE|RESIZE|MACOS_FORCE_ENABLE_SHADOW"] = 1,
["TITLE|RESIZE|MACOS_USE_BACKGROUND_COLOR_AS_TITLEBAR_COLOR"] = 1,
-- TODO: Do the 24 combinations for each of the remaining elements
["TITLE|RESIZE|INTEGRATED_BUTTONS|MACOS_FORCE_DISABLE_SHADOW"] = 1,
["TITLE|RESIZE|INTEGRATED_BUTTONS|MACOS_FORCE_ENABLE_SHADOW"] = 1,
["TITLE|RESIZE|INTEGRATED_BUTTONS|MACOS_USE_BACKGROUND_COLOR_AS_TITLEBAR_COLOR"] = 1,
---Add other valid combinations if needed
}
---@enum (key) PaletteAnsi
local palette_ansi = {
black = 1,
green = 1,
maroon = 1,
navy = 1,
olive = 1,
purple = 1,
silver = 1,
teal = 1,
}
---@enum (key) PaletteBrights
local palette_brights = {
aqua = 1,
blue = 1,
fuchsia = 1,
grey = 1,
lime = 1,
red = 1,
white = 1,
yellow = 1,
}
---@enum (key) AnsiColor
local ansi_color = {
Aqua = 1,
Black = 1,
Blue = 1,
Fuchsia = 1,
Green = 1,
Grey = 1,
Lime = 1,
Maroon = 1,
Navy = 1,
Olive = 1,
Purple = 1,
Red = 1,
Silver = 1,
Teal = 1,
White = 1,
Yellow = 1,
}
---@enum (key) TabBarColor.Underline
local tab_bar_underline = {
Double = 1,
None = 1,
Single = 1,
}
---@class TabBarColor
---The color of the background area for the tab.
---
---@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? FormatItemAttribute.Intensity
---Specify whether you want the text to be italic for this tab.
---
---The default is `false`.
---
---@field italic? boolean
---Specify whether you want the text to be rendered with strikethrough
---or not for this tab.
---
---The default is `false`.
---
---@field strikethrough? boolean
---Specify whether you want `"None"`, `"Single"` or `"Double"`
---underline for label shown for this tab.
---
---The default is `"None"`.
---
---@field underline? TabBarColor.Underline
---@class TabBarColors
---The text color to use when the attributes are reset to default.
---
---@field background? string
---@field inactive_tab_edge? string
---@field inactive_tab_edge_hover? string
---Configure the color and styling for the tab bar.
---
---@class TabBar: TabBarColors
---The active tab is the one that has focus in the window.
---
---@field active_tab? TabBarColor
---The color of the strip that goes along the top of the window
---(does not apply when fancy tab bar is in use).
---
---@field background? string
---Inactive tabs are the tabs that do not have focus.
---
---@field inactive_tab? TabBarColor
---You can configure some alternate styling when
---the mouse pointer moves over inactive tabs.
---
---@field inactive_tab_hover? TabBarColor
---The new tab button that let you create new tabs.
---
---@field new_tab? TabBarColor
---You can configure some alternate styling
---when the mouse pointer moves over the new tab button.
---
---@field new_tab_hover? TabBarColor
---@class Palette
---A list of 8 colors corresponding to the basic ANSI palette.
---
---@field ansi? table<integer, PaletteAnsi>
---The background color to use when the attributes are
---reset to default.
---
---@field background? string
---A list of 8 colors corresponding to the brights.
---
---@field brights? table<integer, PaletteBrights>
---The color to use for the cursor when a dead key
---or leader state is active.
---
---@field compose_cursor? string
---Colors for `copy_mode` and `quick_select`.
---
---In `copy_mode`, the color of the active text is:
---
--- 1. `copy_mode_active_highlight` if additional text was selected
--- using the mouse
--- 2. `selection` otherwise
---
---@field copy_mode_active_highlight_bg? ColorSpec
---Use `AnsiColor` to specify one of the ANSI color palette values
---(index 0-15), using one of the following values:
---
--- - `"Black"`
--- - `"Maroon"`
--- - `"Green"`
--- - `"Olive"`
--- - `"Navy"`
--- - `"Purple"`
--- - `"Teal"`
--- - `"Silver"`
--- - `"Grey"`
--- - `"Red"`
--- - `"Lime"`
--- - `"Yellow"`
--- - `"Blue"`
--- - `"Fuchsia"`
--- - `"Aqua"`
--- - `"White"`
---
---For more information, see:
--- - [`AnsiColor`](lua://AnsiColor)
---
---@field copy_mode_active_highlight_fg? ColorSpec
---Colors for `copy_mode` and `quick_select`.
---
---In `copy_mode`, the color of the active text is:
---
--- - `copy_mode_active_highlight` if additional text
--- was selected using the mouse
--- - `selection` otherwise
---
---@field copy_mode_inactive_highlight_bg? ColorSpec
---Use `AnsiColor` to specify one of the ANSI color palette values
---(index 0-15), using one of the following values:
---
--- - `"Black"`
--- - `"Maroon"`
--- - `"Green"`
--- - `"Olive"`
--- - `"Navy"`
--- - `"Purple"`
--- - `"Teal"`
--- - `"Silver"`
--- - `"Grey"`
--- - `"Red"`
--- - `"Lime"`
--- - `"Yellow"`
--- - `"Blue"`
--- - `"Fuchsia"`
--- - `"Aqua"`
--- - `"White"`
---
---For more information, see:
--- - [`AnsiColor`](lua://AnsiColor)
---
---@field copy_mode_inactive_highlight_fg? ColorSpec
---The background color of the cursor.
---
---@field cursor_bg? string
---The border of the cursor.
---
---@field cursor_border? string
---The foreground color of the cursor.
---
---@field cursor_fg? string
---The text color to use when the attributes are
---reset to default.
---
---@field foreground? string
---A map for setting arbitrary colors ranging from `16`
---to `256` in the color palette.
---
---@field indexed? string[]
---@field input_selector_label_bg? ColorSpec
---@field input_selector_label_fg? ColorSpec
---@field launcher_label_bg? ColorSpec
---@field launcher_label_fg? ColorSpec
---@field quick_select_label_bg? ColorSpec
---@field quick_select_label_fg? ColorSpec
---@field quick_select_match_bg? ColorSpec
---@field quick_select_match_fg? ColorSpec
---The color of the "thumb" of the scrollbar;
---the segment that represents the current viewable area.
---
---@field scrollbar_thumb? string
---The background color of selected text.
---
---@field selection_bg? string
---The foreground color of selected text.
---
---@field selection_fg? string
---The color of the split line between panes.
---
---@field split? string
---@field tab_bar? TabBar
---The color of the visual bell.
---
---If unspecified, the foreground color is used instead.
---
---@field visual_bell? string
---@enum (key) FontWeight
local font_weight = {
Black = 1,
Bold = 1,
Book = 1,
DemiBold = 1,
DemiLight = 1,
ExtraBlack = 1,
ExtraBold = 1,
ExtraLight = 1,
Light = 1,
Medium = 1,
Regular = 1,
Thin = 1,
}
---@enum (key) FontStretch
local font_stretch = {
Condensed = 1,
Expanded = 1,
ExtraCondensed = 1,
ExtraExpanded = 1,
Normal = 1,
SemiCondensed = 1,
SemiExpanded = 1,
UltraCondensed = 1,
UltraExpanded = 1,
}
---@enum (key) FreeTypeLoadFlags
local freetype_load_flags = {
DEFAUlT = 1,
FORCE_AUTOHINT = 1,
MONOCHROME = 1,
NO_AUTOHINT = 1,
NO_BITMAP = 1,
NO_HINTING = 1,
}
---@class FontAttributes
---@field is_fallback? boolean
---@field is_synthetic? boolean
---@field scale? number
---@field stretch? FontStretch
---Whether the font should be an italic variant.
---
---@field style? "Normal"|"Italic"|"Oblique"
---Whether the font should be a bold variant.
---
---@field weight? FontWeight
---@enum (key) FreeTypeTarget
local freetype_target = {
HorizontalLcd = 1,
Light = 1,
Mono = 1,
Normal = 1,
VerticalLcd = 1,
}
---`FontAttributes`-like class but with font family
---and other extensions included.
---
---@class FontFamilyAttributes: FontAttributes
---@field assume_emoji_presentation? boolean
---@field family string
---you can combine the flags like `"NO_HINTING|MONOCHROME"`
---**(you probably wouldn't want to do this)**.
---
---@field freetype_load_flags? FreeTypeLoadFlags
---@field freetype_load_target? FreeTypeTarget
---@field freetype_render_target? FreeTypeTarget
---When `config.font_shaper` is
---set to `"Harfbuzz"`, this setting affects
---how font shaping takes place.
---
---The _OpenType_ spec lists a number of features
---[here](https://docs.microsoft.com/en-us/typography/opentype/spec/featurelist).
---
---For more information and examples, see:
--- - [Font Shaping](https://wezterm.org/config/font-shaping.html)
--- - [`config.font_shaper`](lua://Config.font_shaper)
---
---@field harfbuzz_features? HarfbuzzFeatures[]
---@class Fonts
---@field fonts FontAttributes[]
---@class WindowFrameConfig
---@field active_titlebar_bg? string
---@field active_titlebar_border_bottom? string
---@field active_titlebar_fg? string
---@field border_bottom_color? string
---@field border_bottom_height? string|integer
---@field border_left_color? string
---@field border_left_width? string|integer
---@field border_right_color? string
---@field border_right_width? string|integer
---@field border_top_color? string
---@field border_top_height? string|integer
---@field button_bg? string
---@field button_fg? string
---@field button_hover_bg? string
---@field button_hover_fg? string
---@field font? AllFontAttributes
---@field font_size? number
---@field inactive_titlebar_bg? string
---@field inactive_titlebar_border_bottom? string
---@field inactive_titlebar_fg? string
---@class TabBarStyle
---@field new_tab? string
---@field new_tab_hover? string
---@field window_close? string
---@field window_close_hover? string
---@field window_hide? string
---@field window_hide_hover? string
---@field window_maximize? string
---@field window_maximize_hover? string
---@class HyperlinkRule
---@field format string
---@field highlight? integer
---@field regex string
---@class SerialDomain
---Set the baud rate.
---
---The default is `9600` baud.
---
---@field baud integer
---The name of this specific domain.
---
---Must be unique amongst all types of domain
---in the configuration file.
---
---@field name 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 port string
---@enum (key) GpuInfo.DeviceType
local gpu_device_type = {
Other = 1,
IntegratedGpu = 1,
DiscreteGpu = 1,
Cpu = 1,
}
---@enum (key) GpuInfo.Backend
local gpu_backend = {
Vulkan = 1,
Metal = 1,
Dx12 = 1,
Gl = 1,
}
---Corresponds to [`wgpu::AdapterInfo`](https://docs.rs/wgpu/latest/wgpu/struct.AdapterInfo.html)
---@class GpuInfo
---@field name string
---@field vendor integer
---@field device integer
---@field device_type GpuInfo.DeviceType
---@field backend GpuInfo.Backend
---@field driver? string
---@field driver_info? string
---@class UnixDomain
---If `true`, connect to this domain on startup.
---
---@field connect_automatically boolean
---Show time since last response when waiting for a response.
---
---[Recommended Source](https://wezterm.org/config/lua/pane/get_metadata.html#since_last_response_ms).
---
---@field local_echo_threshold_ms integer
---The name of this specific domain.
---
---Must be unique amongst all types of domain
---in the configuration file.
---
---@field name string
---If `true`, do not attempt to start this server
---if we try and fail to connect to it.
---
---@field no_serve_automatically boolean
---@field overlay_lag_indicator boolean
---Instead of directly connecting to `socket_path`
---spawn this command and use its stdin/stdout
---in place of the socket.
---
---@field proxy_command string[]
---@field read_timeout integer
---If we decide that we need to start the server,
---the command to run to set that up.
---
---The default is to spawn:
---
---```sh
---wezterm-mux-server --daemonize
---```
---
---To start up a UNIX domain inside a WSL container:
---
---```sh
---wsl -e wezterm-mux-server --daemonize
---```
---
---@field serve_command string[]
---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 skip_permissions_check boolean
---@field socket_path string
---@field write_timeout integer
---@class LeaderKey: Key
---Maximum time to wait for next key.
---
---Default is `1000` ms.
---
---@field timeout_milliseconds? integer
---@class HyperLinkRule
---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.
---
---@field format string
---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...
---
---@field highlight? number
---The regular expression to match.
---
---@field regex string
---@enum (key) BatteryInfo.State
local battery_info_state = {
Charging = 1,
Discharging = 1,
Empty = 1,
Full = 1,
Unknown = 1,
}
---@class BatteryInfo
---If known, shows the battery model string or `"unknown"` otherwise.
---
---@field model string
---If known, shows the battery serial number or `"unknown"` otherwise.
---
---@field serial string
---@field state BatteryInfo.State
---The battery level expressed as a number between `0.0` (empty)
---and `1.0` (full).
---
---@field state_of_charge number
---If discharing, how long until the battery is empty (in seconds).
---
---@field time_to_empty? integer
---If charging, how long until the battery is full (in seconds).
---
---@field time_to_full? integer
---If known, shows battery manufacturer name or `"unknown"` otherwise.
---
---@field vendor string
---@class AugmentCommandPaletteReturn
---The action to take when the item is activated.
---
---Can be any key assignment action.
---
---For more information, see:
--- - [`Action`](lua://Action)
---
---@field action Action
---The brief description for the entry.
---
---@field brief 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 doc? string
---**(OPTIONAL)** Nerd Fonts glyph name to use for the icon for the entry.
---
---For a list of icon names, see:
--- - [`Wezterm.NerdFont`](lua://Wezterm.NerdFont)
---
---@field icon? Wezterm.NerdFont
---@enum (key) StableCursorPosition.Shape
local shape = {
BlinkingBar = 1,
BlinkingBlock = 1,
BlinkingUnderline = 1,
SteadyBar = 1,
SteadyBlock = 1,
SteadyUnderline = 1,
}
---Mirrors `StableCursorPosition` in wezterm upstream:
---https://github.com/wezterm/wezterm/blob/main/mux/src/renderable.rs
---
---@class StableCursorPosition
---@field shape StableCursorPosition.Shape
---@field visibility "Visible"|"Hidden"
---The horizontal cell index.
---
---@field x integer
---The vertical stable row index.
---
---@field y integer
---@class LinearGradientOrientation
---@field angle number
---@class RadialGradientOrientation
---@field cx? number
---@field cy? number
---@field radius? number
---@alias GradientOrientation
---|"Horizontal"
---|"Vertical"
---|{ Linear: LinearGradientOrientation }
---|{ Radial: RadialGradientOrientation }
---@enum (key) Gradient.Blend
local blend = {
Hsv = 1,
LinearRgb = 1,
Oklab = 1,
Rgb = 1,
}
---@enum (key) Gradient.Interpolation
local interpolation = {
Basis = 1,
CatmullRom = 1,
Linear = 1,
}
---@class Gradient
---@field blend? Gradient.Blend
---@field colors string[]
---@field interpolation? Gradient.Interpolation
---@field noise? number
---@field orientation? GradientOrientation
---@field segment_size? number
---@field segment_smoothness? number
---@class ColorSchemeMetaData
---@field aliases? string[]
---@field author? string
---@field name? string
---@field origin_url? string
---@field wezterm_version? string
---@enum (key) CursorStyle
local cursor_style = {
BlinkingBar = 1,
BlinkingBlock = 1,
BlinkingUnderline = 1,
SteadyBar = 1,
SteadyBlock = 1,
SteadyUnderline = 1,
}
---@enum (key) Direction
local direction = {
Down = 1,
Left = 1,
Next = 1,
Prev = 1,
Right = 1,
Up = 1,
}
---@alias EasingFunction
---|"Constant"
---|"Ease"
---|"EaseIn"
---|"EaseInOut"
---|"EaseOut"
---|"Linear"
---|{ CubicBezier: number[] }
---@enum (key) Stretch
local stretch = {
Condensed = 1,
Expanded = 1,
ExtraCondensed = 1,
ExtraExpanded = 1,
Normal = 1,
SemiCondensed = 1,
SemiExpanded = 1,
UltraCondensed = 1,
UltraExpanded = 1,
}
---@enum (key) Weight
local weight = {
Black = 1,
Bold = 1,
Book = 1,
DemiBold = 1,
DemiLight = 1,
ExtraBlack = 1,
ExtraBold = 1,
ExtraLight = 1,
Light = 1,
Medium = 1,
Regular = 1,
Thin = 1,
}
---@class ScreenInformation
---@field height number
---@field max_fps? number
---@field name string
---@field width number
---@field x number
---@field y number
---@class GuiScreensInfo
---@field active ScreenInformation
---@field byName table<string, ScreenInformation>
---@field main ScreenInformation
---@field origin_x number
---@field origin_y number
---@field virtual_height number
---@field virtual_width number
---@class KeyBinding: Key
---@field action Action
---@field key string
---@field mods? string
---@class MouseEventInfo
---@field button "Left"|"Right"|"Middle"|{ WheelDown: number }|{ WheelUp: number }
---@field streak number
---@alias MouseEvent
---|{ Down: MouseEventInfo }
---|{ Drag: MouseEventInfo }
---|{ Up: MouseEventInfo }
---@class MouseBindingBase
---@field action Action
---@field alt_screen? boolean|"Any"
---@field event MouseEvent
---@field mouse_reporting? boolean
---@class MouseBinding: MouseBindingBase
---@field mods string
--- - The first event parameter is a `Window`
--- object that represents the GUI window
--- - The second event parameter is a `Pane`
--- object that represents the pane in which
--- the event was triggered.
---
---See:
--- - [`Window`](lua://Window)
--- - [`Pane`](lua://Pane)
---
---@alias CallbackWindowPane fun(window: Window, pane: Pane)
---Action callback type for `InputSelectorParams.action`
---
---See:
--- - [`Window`](lua://Window)
--- - [`Pane`](lua://Pane)
--- - [`InputSelectorParams`](lua://InputSelectorParams)
---
---@alias CallbackInputSelector fun(window: Window, pane: Pane, id?: string, label?: string)
---Action callback type for `PromptInputLineParams.action`
---
---See:
--- - [`Window`](lua://Window)
--- - [`Pane`](lua://Pane)
--- - [`PromptInputLineParams`](lua://PromptInputLineParams)
---
---@alias CallbackPromptInputLine fun(window: Window, pane: Pane, line?: string)
---@alias WezTerm Wezterm
---The `wezterm` module is the primary module that exposes
---WezTerm configuration and control to your config file.
---
---You will typically place:
---
---```lua
---local wezterm = require 'wezterm'
---```
---
---at the top of your configuration file to enable it.
---
---@class Wezterm: ExecDomain
---`wezterm.GLOBAL` is a special `userdata` value that acts
---like a table.
---Writing to keys will copy the data that you assign
---into a global in-memory table and allow it to be read back later.
---
---Provides global, in-process, in-memory, data storage
---for JSON-like variables that persists across config reloads.
---
---WezTerm's Lua files may be re-loaded and re-evaluated
---multiple times in different contexts or in different threads.
---If you'd like to keep track of state that lasts
---for the lifetime of your wezterm process then
---you cannot simply use global variables in the Lua script.
---
---Reads and writes from/to `wezterm.GLOBAL` are thread-safe
---but don't currently provide synchronization primitives for managing
---read-modify-write operations.
---
---You may store values with the following types:
---
--- - `string`
--- - `number`
--- - `table`
--- - `boolean`
---
---**Attempting to assign other types will raise an error.**
---
---@field GLOBAL table<string, string|number|table|boolean>
---Helper for defining key assignment actions
---in your configuration file.
---
---This is really just sugar for the underlying Lua ==> Rust
---deserialation mapping that makes it a bit easier to identify
---where syntax errors may exist in your configuration file.
---
---For more information, see:
--- - [`KeyAssignment`](lua://KeyAssignment)
--- - [`Action`](lua://Action)
---
---@field action KeyAssignment
---The `wezterm.color` module exposes functions
---that work with colors.
---
---For more information, see:
--- - [`Wezterm.Color`](lua://Wezterm.Color)