this repo has no description
1// Queries
2pub const primary_device_attrs = "\x1b[c";
3pub const tertiary_device_attrs = "\x1b[=c";
4pub const device_status_report = "\x1b[5n";
5pub const xtversion = "\x1b[>0q";
6pub const decrqm_focus = "\x1b[?1004$p";
7pub const decrqm_sgr_pixels = "\x1b[?1016$p";
8pub const decrqm_sync = "\x1b[?2026$p";
9pub const decrqm_unicode = "\x1b[?2027$p";
10pub const decrqm_color_scheme = "\x1b[?2031$p";
11pub const csi_u_query = "\x1b[?u";
12pub const kitty_graphics_query = "\x1b_Gi=1,a=q\x1b\\";
13pub const sixel_geometry_query = "\x1b[?2;1;0S";
14pub const cursor_position_request = "\x1b[6n";
15pub const explicit_width_query = "\x1b]66;w=1; \x1b\\";
16pub const scaled_text_query = "\x1b]66;s=2; \x1b\\";
17pub const multi_cursor_query = "\x1b[> q";
18
19// mouse. We try for button motion and any motion. terminals will enable the
20// last one we tried (any motion). This was added because zellij doesn't
21// support any motion currently
22// See: https://github.com/zellij-org/zellij/issues/1679
23pub const mouse_set = "\x1b[?1002;1003;1004;1006h";
24pub const mouse_set_pixels = "\x1b[?1002;1003;1004;1016h";
25pub const mouse_reset = "\x1b[?1002;1003;1004;1006;1016l";
26
27// in-band window size reports
28pub const in_band_resize_set = "\x1b[?2048h";
29pub const in_band_resize_reset = "\x1b[?2048l";
30
31// sync
32pub const sync_set = "\x1b[?2026h";
33pub const sync_reset = "\x1b[?2026l";
34
35// unicode
36pub const unicode_set = "\x1b[?2027h";
37pub const unicode_reset = "\x1b[?2027l";
38pub const explicit_width = "\x1b]66;w={d};{s}\x1b\\";
39
40// text sizing
41pub const scaled_text = "\x1b]66;s={d}:w={d};{s}\x1b\\";
42pub const scaled_text_with_fractions = "\x1b]66;s={d}:w={d}:n={d}:d={d}:v={d};{s}\x1b\\";
43
44// bracketed paste
45pub const bp_set = "\x1b[?2004h";
46pub const bp_reset = "\x1b[?2004l";
47
48// color scheme updates
49pub const color_scheme_request = "\x1b[?996n";
50pub const color_scheme_set = "\x1b[?2031h";
51pub const color_scheme_reset = "\x1b[?2031l";
52
53// Key encoding
54pub const csi_u_push = "\x1b[>{d}u";
55pub const csi_u_pop = "\x1b[<u";
56
57// Cursor
58pub const home = "\x1b[H";
59pub const cup = "\x1b[{d};{d}H";
60pub const hide_cursor = "\x1b[?25l";
61pub const show_cursor = "\x1b[?25h";
62pub const cursor_shape = "\x1b[{d} q";
63pub const ri = "\x1bM";
64pub const ind = "\n";
65pub const cuf = "\x1b[{d}C";
66pub const cub = "\x1b[{d}D";
67
68// Multi Cursor
69pub const secondary_cursors_rgb = "\x1b[>40;2:{d}:{d}:{d} q";
70pub const reset_secondary_cursors = "\x1b[>0;4 q";
71pub const show_secondary_cursor = "\x1b[>29;2:{d}:{d} q";
72
73// Erase
74pub const erase_below_cursor = "\x1b[J";
75
76// alt screen
77pub const smcup = "\x1b[?1049h";
78pub const rmcup = "\x1b[?1049l";
79
80// sgr reset all
81pub const sgr_reset = "\x1b[m";
82
83// colors
84pub const fg_base = "\x1b[3{d}m";
85pub const fg_bright = "\x1b[9{d}m";
86pub const bg_base = "\x1b[4{d}m";
87pub const bg_bright = "\x1b[10{d}m";
88
89pub const fg_reset = "\x1b[39m";
90pub const bg_reset = "\x1b[49m";
91pub const ul_reset = "\x1b[59m";
92pub const fg_indexed = "\x1b[38:5:{d}m";
93pub const bg_indexed = "\x1b[48:5:{d}m";
94pub const ul_indexed = "\x1b[58:5:{d}m";
95pub const fg_rgb = "\x1b[38:2:{d}:{d}:{d}m";
96pub const bg_rgb = "\x1b[48:2:{d}:{d}:{d}m";
97pub const ul_rgb = "\x1b[58:2:{d}:{d}:{d}m";
98pub const fg_indexed_legacy = "\x1b[38;5;{d}m";
99pub const bg_indexed_legacy = "\x1b[48;5;{d}m";
100pub const ul_indexed_legacy = "\x1b[58;5;{d}m";
101pub const fg_rgb_legacy = "\x1b[38;2;{d};{d};{d}m";
102pub const bg_rgb_legacy = "\x1b[48;2;{d};{d};{d}m";
103pub const ul_rgb_legacy = "\x1b[58;2;{d};{d};{d}m";
104pub const ul_rgb_conpty = "\x1b[58:2::{d}:{d}:{d}m";
105
106// Underlines
107pub const ul_off = "\x1b[24m"; // NOTE: this could be \x1b[4:0m but is not as widely supported
108pub const ul_single = "\x1b[4m";
109pub const ul_double = "\x1b[4:2m";
110pub const ul_curly = "\x1b[4:3m";
111pub const ul_dotted = "\x1b[4:4m";
112pub const ul_dashed = "\x1b[4:5m";
113
114// Attributes
115pub const bold_set = "\x1b[1m";
116pub const dim_set = "\x1b[2m";
117pub const italic_set = "\x1b[3m";
118pub const blink_set = "\x1b[5m";
119pub const reverse_set = "\x1b[7m";
120pub const invisible_set = "\x1b[8m";
121pub const strikethrough_set = "\x1b[9m";
122pub const bold_dim_reset = "\x1b[22m";
123pub const italic_reset = "\x1b[23m";
124pub const blink_reset = "\x1b[25m";
125pub const reverse_reset = "\x1b[27m";
126pub const invisible_reset = "\x1b[28m";
127pub const strikethrough_reset = "\x1b[29m";
128
129// OSC sequences
130pub const osc2_set_title = "\x1b]2;{s}\x1b\\";
131pub const osc7 = "\x1b]7;{f}\x1b\\";
132pub const osc8 = "\x1b]8;{s};{s}\x1b\\";
133pub const osc8_clear = "\x1b]8;;\x1b\\";
134pub const osc9_notify = "\x1b]9;{s}\x1b\\";
135pub const osc777_notify = "\x1b]777;notify;{s};{s}\x1b\\";
136pub const osc22_mouse_shape = "\x1b]22;{s}\x1b\\";
137pub const osc52_clipboard_copy = "\x1b]52;c;{s}\x1b\\";
138pub const osc52_clipboard_request = "\x1b]52;c;?\x1b\\";
139
140// Kitty graphics
141pub const kitty_graphics_clear = "\x1b_Ga=d\x1b\\";
142pub const kitty_graphics_preamble = "\x1b_Ga=p,i={d}";
143pub const kitty_graphics_closing = ",C=1\x1b\\";
144
145// Color control sequences
146pub const osc4_query = "\x1b]4;{d};?\x1b\\"; // color index {d}
147pub const osc4_reset = "\x1b]104\x1b\\"; // this resets _all_ color indexes
148pub const osc10_query = "\x1b]10;?\x1b\\"; // fg
149pub const osc10_set = "\x1b]10;rgb:{x:0>2}{x:0>2}/{x:0>2}{x:0>2}/{x:0>2}{x:0>2}\x1b\\"; // set default terminal fg
150pub const osc10_reset = "\x1b]110\x1b\\"; // reset fg to terminal default
151pub const osc11_query = "\x1b]11;?\x1b\\"; // bg
152pub const osc11_set = "\x1b]11;rgb:{x:0>2}{x:0>2}/{x:0>2}{x:0>2}/{x:0>2}{x:0>2}\x1b\\"; // set default terminal bg
153pub const osc11_reset = "\x1b]111\x1b\\"; // reset bg to terminal default
154pub const osc12_query = "\x1b]12;?\x1b\\"; // cursor color
155pub const osc12_set = "\x1b]12;rgb:{x:0>2}{x:0>2}/{x:0>2}{x:0>2}/{x:0>2}{x:0>2}\x1b\\"; // set terminal cursor color
156pub const osc12_reset = "\x1b]112\x1b\\"; // reset cursor to terminal default
157
158test {
159 const std = @import("std");
160 std.testing.refAllDecls(@This());
161}