Severity: MEDIUM-HIGH Status: Fixed
The per-pane border-format cache is keyed by a generation counter that moves only when the pane-border-format option string itself changes:
// src/cmd/cmd.zig:964-971
if (std.mem.eql(u8, option_name, "pane-border-format")) {
if (server.activeSession()) |session| {
session.border_format_gen +%= 1;
}
}
The render path serves the cached already-expanded string whenever the generation still matches:
// src/server/server.zig:3031
if (pb.pane.border_format_gen == border_gen and pb.pane.border_format_cached != null) {
pb.border_format = pb.pane.border_format_cached.?; // stale if dims changed
continue;
}
border_format_cached stores the fully-expanded string (with #{pane_width}, #{pane_height}, #{pane_index} already substituted).border_format_gen does not change, so the cached expanded string — computed for the old geometry — is reused.pane-border-format option. Only impacts templates that reference dimension/position variables.Bump session.border_format_gen on any layout/geometry change that affects pane dimensions or ordering (resize, split, kill-pane, swap, rotate), not just on option edits. Or re-expand every frame and use the cache only for the compiled ops (not the substituted string).