a modern tui library written in zig
at v0.1.0 96 lines 3.0 kB view raw
1// Queries 2pub const primary_device_attrs = "\x1b[c"; 3pub const tertiary_device_attrs = "\x1b[=c"; 4pub const xtversion = "\x1b[>0q"; 5pub const decrqm_focus = "\x1b[?1004$p"; 6pub const decrqm_sync = "\x1b[?2026$p"; 7pub const decrqm_unicode = "\x1b[?2027$p"; 8pub const decrqm_color_theme = "\x1b[?2031$p"; 9pub const csi_u_query = "\x1b[?u"; 10pub const kitty_graphics_query = "\x1b_Gi=1,a=q\x1b\\"; 11pub const sixel_geometry_query = "\x1b[?2;1;0S"; 12 13// mouse 14pub const mouse_set = "\x1b[?1003;1004;1006h"; 15pub const mouse_reset = "\x1b[?1003;1004;1006l"; 16 17// sync 18pub const sync_set = "\x1b[?2026h"; 19pub const sync_reset = "\x1b[?2026l"; 20 21// unicode 22pub const unicode_set = "\x1b[?2027h"; 23pub const unicode_reset = "\x1b[?2027l"; 24 25// bracketed paste 26pub const bp_set = "\x1b[?2004h"; 27pub const bp_reset = "\x1b[?2004l"; 28 29// Key encoding 30pub const csi_u_push = "\x1b[>{d}u"; 31pub const csi_u_pop = "\x1b[<u"; 32 33// Cursor 34pub const home = "\x1b[H"; 35pub const cup = "\x1b[{d};{d}H"; 36pub const hide_cursor = "\x1b[?25l"; 37pub const show_cursor = "\x1b[?25h"; 38 39// alt screen 40pub const smcup = "\x1b[?1049h"; 41pub const rmcup = "\x1b[?1049l"; 42 43// sgr reset all 44pub const sgr_reset = "\x1b[m"; 45 46// colors 47pub const fg_base = "\x1b[3{d}m"; 48pub const fg_bright = "\x1b[9{d}m"; 49pub const bg_base = "\x1b[4{d}m"; 50pub const bg_bright = "\x1b[10{d}m"; 51 52pub const fg_reset = "\x1b[39m"; 53pub const bg_reset = "\x1b[49m"; 54pub const ul_reset = "\x1b[59m"; 55pub const fg_indexed = "\x1b[38:5:{d}m"; 56pub const bg_indexed = "\x1b[48:5:{d}m"; 57pub const ul_indexed = "\x1b[58:5:{d}m"; 58pub const fg_rgb = "\x1b[38:2:{d}:{d}:{d}m"; 59pub const bg_rgb = "\x1b[48:2:{d}:{d}:{d}m"; 60pub const ul_rgb = "\x1b[58:2:{d}:{d}:{d}m"; 61 62// Underlines 63pub const ul_off = "\x1b[24m"; // NOTE: this could be \x1b[4:0m but is not as widely supported 64pub const ul_single = "\x1b[4m"; 65pub const ul_double = "\x1b[4:2m"; 66pub const ul_curly = "\x1b[4:3m"; 67pub const ul_dotted = "\x1b[4:4m"; 68pub const ul_dashed = "\x1b[4:5m"; 69 70// Attributes 71pub const bold_set = "\x1b[1m"; 72pub const dim_set = "\x1b[2m"; 73pub const italic_set = "\x1b[3m"; 74pub const blink_set = "\x1b[5m"; 75pub const reverse_set = "\x1b[7m"; 76pub const invisible_set = "\x1b[8m"; 77pub const strikethrough_set = "\x1b[9m"; 78pub const bold_dim_reset = "\x1b[22m"; 79pub const italic_reset = "\x1b[23m"; 80pub const blink_reset = "\x1b[25m"; 81pub const reverse_reset = "\x1b[27m"; 82pub const invisible_reset = "\x1b[28m"; 83pub const strikethrough_reset = "\x1b[29m"; 84 85// OSC sequences 86pub const osc2_set_title = "\x1b]2;{s}\x1b\\"; 87pub const osc8 = "\x1b]8;{s};{s}\x1b\\"; 88pub const osc8_clear = "\x1b]8;;\x1b\\"; 89pub const osc9_notify = "\x1b]9;{s}\x1b\\"; 90pub const osc777_notify = "\x1b]777;notify;{s};{s}\x1b\\"; 91pub const osc22_mouse_shape = "\x1b]22;{s}\x1b\\"; 92 93// Kitty graphics 94pub const kitty_graphics_clear = "\x1b_Ga=d\x1b\\"; 95pub const kitty_graphics_place = "\x1b_Ga=p,i={d},z={d},C=1\x1b\\"; 96pub const kitty_graphics_scale = "\x1b_Ga=p,i={d},z={d},c={d},r={d},C=1\x1b\\";