\x1b[38;5;999m kills the whole serverFile: src/screen.zig:1306,1316,1332,1342,1358,1362 (reached from
src/input.zig:743-759)
Severity: CRITICAL
Status: ✅ FIXED
Any pane output containing an out-of-range SGR colour parameter crashes szn in Debug/ReleaseSafe (“integer does not fit in destination type” — empirically confirmed with Zig 0.16.0). ReleaseFast silently wraps to a wrong palette slot.
The CSI param parser deliberately saturates values to maxInt(u32) (bug #99,
input.zig:274) — but setSgr then did:
const idx = params[i];
i += 1;
self.cur_cell.fg = Colour.fromIndexed(@intCast(idx)); // idx: u32 → u8
at the indexed-colour and RGB parameter sites (38;5 / 48;5 / 38;2 / 48;2). The range-prong sites (30–37, 40–47, 90–97, 100–107) were provably safe.
38;5;N / 48;5;N): out-of-range indices (>255) are ignored
(xterm behaviour) — previous colour kept.38;2;R;G;B / 48;2;…): channels wrapped mod 256 before conversion.Test: setSgr out-of-range colour params do not panic — bug #354
(maxInt index, 300/999 channels, wrap + ignore semantics asserted).