szn

Bug 320 — State desync on cmdJoinPane layout node lookup failure

320. State desync on cmdJoinPane layout node lookup failure

File: src/cmd/cmd.zig:401-415 Severity: HIGH Status: ✅ FIXED

In cmdJoinPane, dst_win.panes.items was updated with sp before looking up dummy_node = findLeafParent(..., dummy_pane).

Root Cause

Mutating window pane state prior to validating tree lookup results.

Fix

Validated findLeafParent(..., dummy_pane) first and assigned dummy_node.leaf = sp before updating dst_win.panes.items, preventing partial state mutations if lookup fails.

Impact

Lookup failure in cmdJoinPane previously left orphaned panes in the panes list without a matching layout node, causing rendering/resize failures.