diff --git a/examples/text_input.zig b/examples/text_input.zig index 66f0596..aa6a825 100644 --- a/examples/text_input.zig +++ b/examples/text_input.zig @@ -34,6 +34,8 @@ pub fn main() !void { var text_input = TextInput.init(alloc); defer text_input.deinit(); + try vx.queryTerminal(); + // The main event loop. Vaxis provides a thread safe, blocking, buffered // queue which can serve as the primary event queue for an application outer: while (true) { @@ -49,9 +51,12 @@ pub fn main() !void { else => color_idx + 1, }; try text_input.update(.{ .key_press = key }); - if (key.codepoint == 'c' and key.mods.ctrl) { + if (key.matches('c', .{ .ctrl = true })) { break :outer; } + if (key.matches('l', .{ .ctrl = true })) { + vx.queueRefresh(); + } }, .winsize => |ws| { try vx.resize(alloc, ws); diff --git a/src/ctlseqs.zig b/src/ctlseqs.zig index 5eee203..05d0f81 100644 --- a/src/ctlseqs.zig +++ b/src/ctlseqs.zig @@ -10,6 +10,10 @@ pub const csi_u_query = "\x1b[?u"; pub const kitty_graphics_query = "\x1b_Gi=1,a=q\x1b\\"; pub const sixel_geometry_query = "\x1b[?2;1;0S"; +// sync +pub const sync_set = "\x1b[?2026h"; +pub const sync_reset = "\x1b[?2026l"; + // Key encoding pub const csi_u_push = "\x1b[>{d}u"; pub const csi_u_pop = "\x1b[