···1414const Hyperlink = @import("cell.zig").Hyperlink;
1515const gwidth = @import("gwidth.zig");
1616const Shape = @import("Mouse.zig").Shape;
1717+const Placement = Screen.Placement;
17181819/// Vaxis is the entrypoint for a Vaxis application. The provided type T should
1920/// be a tagged union which contains all of the events the application will
···242243 // the next render call will refresh the entire screen
243244 pub fn queueRefresh(self: *Self) void {
244245 self.refresh = true;
246246+ self.screen_last.images.clearRetainingCapacity();
245247 }
246248247249 /// draws the screen to the terminal
···277279 var col: usize = 0;
278280 var cursor: Style = .{};
279281 var link: Hyperlink = .{};
282282+283283+ // delete remove images from the screen by looping through the
284284+ // current state and comparing to the next state
285285+ for (self.screen_last.images.items) |last_img| {
286286+ const keep: bool = for (self.screen.images.items) |next_img| {
287287+ if (std.meta.eql(last_img, next_img)) break true;
288288+ } else false;
289289+ if (keep) continue;
290290+ }
280291281292 var i: usize = 0;
282293 while (i < self.screen.buf.len) {