szn

Bug 359 — Clock mode: full-grid clone per second, arena never reclaimed

359. Leaving clock mode on for an hour can consume gigabytes

File: src/grid.zig:180-192, src/server/server.zig:2881-2895 Severity: HIGH Status: ✅ FIXED

Problem

Clock mode previously re-cloned the entire saved_grid — including all scrollback history (up to 2,000 lines) — every second into the session arena. Because ArenaAllocator.free is a no-op, this permanently grew memory by megabytes per minute.

Root Cause

if (sg.clone(grid_alloc)) |cloned| {
    pane.screen.grid.deinit();     // arena no-op
    pane.screen.grid = cloned;

Fix (applied)