status.buildLine left/right templates resolve to the LAST window, not the active onestatus.buildLine left/right templates resolve to the LAST window, not the active oneFile: src/status.zig:271–313
Severity: MEDIUM
Status: ✅ FIXED — active-window vars are re-applied after the centre (window-list) loop.
buildLine first sets window_index/window_name/window_flags/window_active to the active window’s values. The centre loop then overwrites those same four keys for every window, leaving the last window’s values in the ctx. renderWithCache then expands the user’s status-left/status-right (which may reference #I, #W, #F, #{window_active}) against that last-window state. The default templates dodge this (status-left uses #{session_name}, status-right uses #{pane_title}), but any user template referencing window vars shows the wrong window.
Fix: After the centre loop, re-scan for the active window and re-set the four keys before renderWithCache.