mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-24 12:46:10 +03:00
memset zero values when resizing a screen
Zig safety checks save us! It was setting undefined values to `0xAA` and we caught that in a crash. We need to zero this memory. Practically this happened when `cat`-ing a large file, then attempting to select and copy any blank trailing space.
This commit is contained in:
@ -361,6 +361,7 @@ pub fn resize(self: *Screen, alloc: Allocator, rows: usize, cols: usize) !void {
|
||||
|
||||
// Reallocate the storage
|
||||
self.storage = try alloc.alloc(Cell, (rows + self.max_scrollback) * cols);
|
||||
std.mem.set(Cell, self.storage, .{ .char = 0 });
|
||||
self.top = 0;
|
||||
self.bottom = rows;
|
||||
self.rows = rows;
|
||||
|
Reference in New Issue
Block a user