From 250bd35830f80788f4b80e5c83b34bfa6986f112 Mon Sep 17 00:00:00 2001 From: moni Date: Fri, 6 Dec 2024 09:44:20 +0800 Subject: [PATCH] termio: clear kitty images when deleting above the cursor --- src/termio/Termio.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/termio/Termio.zig b/src/termio/Termio.zig index 1ebe84541..bbcee7906 100644 --- a/src/termio/Termio.zig +++ b/src/termio/Termio.zig @@ -478,6 +478,18 @@ pub fn clearScreen(self: *Termio, td: *ThreadData, history: bool) !void { ); } + // Clear all Kitty graphics state for this screen. This copies + // Kitty's behavior when Cmd+K deletes all Kitty graphics. I + // didn't spend time researching whether it only deletes Kitty + // graphics that are placed baove the cursor or if it deletes + // all of them. We delete all of them for now but if this behavior + // isn't fully correct we should fix this later. + self.terminal.screen.kitty_images.delete( + self.terminal.screen.alloc, + &self.terminal, + .{ .all = true }, + ); + return; }