szn

Bug 495 — renderContent drops the last row with status bar disabled

495. Double-subtracted status row

Severity: MEDIUM (blank/stale bottom row whenever the status bar is off) Status: 🟢 FIXED Files: src/server/render.zig:551

Problem

pub fn renderContent(self: Display, screen: *Screen) Error!void {
    const h = @min(screen.grid.height, self.sy -| 1);

renderContent unconditionally reserves one row for the status bar. But renderAll already sizes the merged screen to exclude the status row (merged_h = if (status_enabled) self.sy -| 1 else self.sy). With the status bar disabled, the merged grid has sy rows but only sy - 1 are painted — the bottom row stays blank/stale while the cursor may legitimately sit there.

Proposed Fix

const h = @min(screen.grid.height, self.sy);

with the status reservation moved to the caller that knows whether the status bar is enabled — but first verify no other caller relies on the current reservation (the - 1 may be load-bearing for the status-enabled path via a different route).

Resolution

Changed const h = @min(screen.grid.height, self.sy -| 1); to const h = @min(screen.grid.height, self.sy); in Display.renderContent. The caller renderAll already controls the status bar reservation via merged_h = if (status_enabled) self.sy -| 1 else self.sy, allowing all rows up to self.sy to be rendered when the status bar is disabled. Added regression test renderContent renders bottom row when screen height equals display.sy — bug #495.