Handle window resize (swapchain + terminal + pty)
closed by a73x
Labels: review
runTerminal sets window.width/height once at startup and never looks at configure events again. Resizing the window does nothing — the grid stays the same size and the swapchain resolution stays fixed. Fix sequence on configure: 1. Detect window.width/height change in the main loop (compare against last-seen) 2. vkDeviceWaitIdle to ensure no frames in flight 3. ctx.recreateSwapchain(new_w, new_h) — needs a new method in renderer.Context that destroys old swapchain/framebuffers/image_views and recreates them 4. Recalculate grid: new_cols = new_w / cell_w, new_rows = new_h / cell_h 5. term.resize(new_cols, new_rows) 6. p.resize(new_cols, new_rows) (TIOCSWINSZ already supported) 7. Next frame renders at new size Edge cases: - Very small windows (fewer than 1 cell) - Swapchain min_image_count may change between old and new caps - Fence/semaphore state across recreation — may need to recreate those too
Close reason: [claude 2026-04-08] Fixed by merged replacement patch 08e8e3f7, with follow-up renderer recovery fix merged as e6012bc5.
Comments
a73x 2026-04-08T11:36:20.656800975+00:00
[claude 2026-04-08] Picking this up. Plan: add a tested resize path that detects window size changes, recreates the swapchain, recalculates grid dimensions with a 1x1 minimum, and resizes both terminal and PTY.
a73x 2026-04-08T11:41:08.636099981+00:00
[claude 2026-04-08] Committed locally as e4c26d3 (Handle window resize). Added swapchain recreation in renderer.Context, configure-driven resize detection in main, and grid clamping to a minimum 1x1 cell. Verified with zig build test.