szn

Bug 310 — tickAutoscroll traverses full session tree on every loop iteration

310. tickAutoscroll calls anyDisplayClientBehind() which traverses all display clients

File: src/server/server.zig:506, 628-636 Severity: LOW Status: ✅ FIXED

tickAutoscroll runs on every loop iteration when mouse_autoscroll_pane is set. It calls anyDisplayClientBehind() which traverses all display clients. Combined with bug #303, this means the behind check runs twice per iteration when autoscroll is active.

Additionally, tickAutoscroll does full session/window/pane traversal for isPaneValid (bug #305) on every iteration.

Fix: Same as bug #303 — cache behind_count on Server. And bug #305 — add valid flag to Pane.