szn

Bug 222 — New panes in existing sessions miss cell pixel size initialization — sixels use stale defaults

222. New panes in existing sessions miss cell pixel size initialization — sixels use stale defaults

File: src/server/server.zig:2542–2551 (newSession), src/window.zig:116–120 (Window.init), src/layout.zig:108 (splitPane) Severity: HIGH Status: ✅ FIXED — Window.init now takes an optional parent_screen parameter and propagates cell_size_known/cell_px_* to the new pane.

newSession correctly propagates cell_size_known and cell_px_* to the initial pane’s screen:

p.screen.cell_size_known = self.cell_size_known;
p.screen.updateCellSize(self.cell_px_height, self.cell_px_width);

However, Window.init (which creates the initial pane for a new window) and Layout.splitPane (which creates a pane for split operations) both call Pane.init → Screen.init, which sets cell_size_known = false with the built-in defaults (10×20 px). These code paths never propagate the server’s measured cell size. A pane created via split-window or new-window after the initial session setup will use stale defaults, causing sixel image footprints to be misjudged until the display client sends another cell_size message.

Fix: After creating a new pane in Window.init and Layout.splitPane, propagate cell_size_known and cell_px_* from the server (or from the parent pane) to the new pane’s screen.