robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Kylefeat(tui): $NVIM_TERMDEFS can override builtin terminfo #3955584d5c5f4bf

master
2.8 KiB107 linesraw
1local M = {}
2
3M.fields = {}
4M.fields.bools = { 'back_color_erase', 'Tc', 'RGB', 'Su' }
5M.fields.ints = { 'max_colors', 'lines', 'columns' }
6
7M.builtin_terminals = {
8  { 'ansi', 'ansi_terminfo' },
9  { 'ghostty', 'ghostty_terminfo' }, -- Note: ncurses defs do not exactly match what ghostty ships.
10  { 'interix', 'interix_8colour_terminfo' },
11  { 'iterm2', 'iterm_256colour_terminfo' },
12  { 'linux', 'linux_16colour_terminfo' },
13  { 'putty-256color', 'putty_256colour_terminfo' },
14  { 'rxvt-256color', 'rxvt_256colour_terminfo' },
15  { 'screen-256color', 'screen_256colour_terminfo' },
16  { 'st-256color', 'st_256colour_terminfo' },
17  { 'tmux-256color', 'tmux_256colour_terminfo' },
18  { 'vte-256color', 'vte_256colour_terminfo' },
19  { 'xterm-256color', 'xterm_256colour_terminfo' },
20  { 'cygwin', 'cygwin_terminfo' },
21  { 'win32con', 'win32con_terminfo' },
22  { 'conemu', 'conemu_terminfo' },
23  { 'vtpcon', 'vtpcon_terminfo' },
24}
25
26M.fields.strings = {
27  'carriage_return',
28  'change_scroll_region',
29  'clear_screen',
30  'clr_eol',
31  'clr_eos',
32  'cursor_address',
33  'cursor_down',
34  'cursor_invisible',
35  'cursor_left',
36  'cursor_home',
37  'cursor_normal',
38  'cursor_up',
39  'cursor_right',
40  'delete_line',
41  'enter_blink_mode',
42  'enter_bold_mode',
43  'enter_ca_mode',
44  'enter_dim_mode',
45  'enter_italics_mode',
46  'enter_reverse_mode',
47  'enter_secure_mode',
48  'enter_standout_mode',
49  'enter_underline_mode',
50  'erase_chars',
51  'exit_attribute_mode',
52  'exit_ca_mode',
53  'from_status_line',
54  'insert_line',
55  'keypad_local',
56  'keypad_xmit',
57  'parm_delete_line',
58  'parm_down_cursor',
59  'parm_insert_line',
60  'parm_left_cursor',
61  'parm_right_cursor',
62  'parm_up_cursor',
63  'set_a_background',
64  'set_a_foreground',
65  'set_attributes',
66  'set_lr_margin',
67  'to_status_line',
68}
69
70M.fields.strings_ext = {
71  -- the following are our custom name for extensions, see "extmap"
72  { 'reset_cursor_style', 'Se' },
73  { 'set_cursor_style', 'Ss' },
74  -- terminfo describes strikethrough modes as rmxx/smxx with respect
75  -- to the ECMA-48 strikeout/crossed-out attributes.
76  { 'enter_strikethrough_mode', 'smxx' },
77  { 'set_rgb_foreground', 'setrgbf' },
78  { 'set_rgb_background', 'setrgbb' },
79  { 'set_cursor_color', 'Cs' },
80  { 'reset_cursor_color', 'Cr' },
81  { 'set_underline_style', 'Smulx' },
82}
83
84-- Note: these are only consumed by driver-ti via it's table of "funcs" keys.
85-- Second value is whether there is a "shift" variant in terminfo.
86M.fields.termkeys = {
87  { 'backspace', false },
88  { 'beg', true }, -- sometimes known as: "begin"
89  { 'btab', false },
90  { 'clear', false },
91  { 'dc', true },
92  { 'end', true },
93  { 'find', true },
94  { 'home', true },
95  { 'ic', true },
96  { 'npage', false },
97  { 'ppage', false },
98  { 'select', false },
99  { 'suspend', true },
100  { 'undo', true },
101  { 'left', true },
102  { 'right', true },
103}
104
105M.fields.func_key_max = 63
106
107return M