P1;P2;P3) stripped by InputParser and unclamped raster-free px_heightadvanceDcsParam drops P1;P2;P3 before 'q' and dispatchDcsSixel leaves fallback px_height unclampedSeverity: MEDIUM
Status: ✅ RESOLVED
Files: src/input.zig:436-454, src/input.zig:600-607
P1;P2;P3) discarded (src/input.zig:436-454):
fn advanceDcsParam(self: *InputParser, byte: u8) Error!void {
switch (byte) {
0x30...0x3B => {},
'q' => {
self.dcs_buf.clearRetainingCapacity();
try self.dcs_buf.appendSlice(self.screen.allocator, "\x1bPq");
self.state = .dcs_sixel;
},
A DECSIXEL introducer has the form ESC P P1 ; P2 ; P3 q, where P2 = 1 selects a transparent background (leaves zero-valued sixel pixels at their current screen color instead of filling the bounding box with background color 0) and P1/P3 control aspect ratio and horizontal grid size. Because 0x30...0x3B is a no-op and "\x1bPq" is hardcoded, all sixel images lose transparency (P2=1) when rendered through szn.
px_height in dispatchDcsSixel (src/input.zig:600-607):
When a sixel stream omits the "Pan;Pad;Ph;Pv raster header, parseSixelDimensions computes px_height from bands * 6:
if (px_height == 0) {
px_height = bands * 6;
if (px_height == 0) px_height = 6;
}
Unlike the raster header path (which clamps pv to MAX_SIXEL_DIM = 16384), bands * 6 is neither saturating (*|) nor clamped to MAX_SIXEL_DIM.
ESC P / 0x90, and when 'q' arrives with empty intermediate bytes, emit "\x1bP" ++ params ++ "q" into self.dcs_buf.parseSixelDimensions, compute px_height = @min(bands *| 6, MAX_SIXEL_DIM).