From 6abfd8fc3f67fb46e0ed4a3c69686dfd28998110 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 3 May 2024 13:57:03 -0500 Subject: [PATCH] render: skip clearing images if they aren't supported --- examples/nvim.zig | 2 +- src/Vaxis.zig | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/nvim.zig b/examples/nvim.zig index f2b4112..f74fc15 100644 --- a/examples/nvim.zig +++ b/examples/nvim.zig @@ -33,7 +33,7 @@ pub fn main() !void { defer loop.stop(); // Optionally enter the alternate screen - try vx.enterAltScreen(); + // try vx.enterAltScreen(); var nvim = try vaxis.widgets.nvim.Nvim(Event).init(alloc, &loop); try nvim.spawn(); diff --git a/src/Vaxis.zig b/src/Vaxis.zig index 7130f5a..2554fcf 100644 --- a/src/Vaxis.zig +++ b/src/Vaxis.zig @@ -251,7 +251,8 @@ pub fn render(self: *Vaxis) !void { } = .{}; // Clear all images - _ = try tty.write(ctlseqs.kitty_graphics_clear); + if (self.caps.kitty_graphics) + _ = try tty.write(ctlseqs.kitty_graphics_clear); var i: usize = 0; while (i < self.screen.buf.len) {