From 67bbc1ee072aa390838c66caf4ed47edee282dc4 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 16 Feb 2026 14:49:48 +0100 Subject: [PATCH] fix: do not emit any kitty multi cursor sequences if support is not detected --- src/Vaxis.zig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Vaxis.zig b/src/Vaxis.zig index ea278c8..a6a3830 100644 --- a/src/Vaxis.zig +++ b/src/Vaxis.zig @@ -799,7 +799,7 @@ pub fn render(self: *Vaxis, tty: *IoWriter) !void { self.state.cursor.row = cursor_pos.row; self.state.cursor.col = cursor_pos.col; } - if (self.screen.cursor_vis) { + if (self.screen.cursor_vis and self.caps.multi_cursor) { try tty.print(ctlseqs.reset_secondary_cursors, .{}); for (self.screen.cursor_secondary) |cur| try tty.print(ctlseqs.show_secondary_cursor, .{ cur.row + 1, cur.col + 1 }); @@ -1136,9 +1136,11 @@ pub fn setTerminalCursorColor(self: *Vaxis, tty: *IoWriter, rgb: [3]u8) !void { /// Set the terminal secondary cursor color pub fn setTerminalCursorSecondaryColor(self: *Vaxis, tty: *IoWriter, rgb: [3]u8) error{WriteFailed}!void { - try tty.print(ctlseqs.secondary_cursors_rgb, .{ rgb[0], rgb[1], rgb[2] }); - try tty.flush(); - self.state.changed_cursor_color = true; + if (self.caps.multi_cursor) { + try tty.print(ctlseqs.secondary_cursors_rgb, .{ rgb[0], rgb[1], rgb[2] }); + try tty.flush(); + self.state.changed_cursor_color = true; + } } pub fn resetAllTerminalSecondaryCursors(self: *Vaxis, alloc: std.mem.Allocator) error{OutOfMemory}!void { -- 2.51.2