mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
terminal: sgr direct bg also had wrong slice len
This commit is contained in:
@ -225,7 +225,7 @@ pub const Parser = struct {
|
|||||||
.b = @truncate(rgb[2]),
|
.b = @truncate(rgb[2]),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
} else if (slice.len >= 2 and slice[1] == 5) {
|
} else if (slice.len >= 3 and slice[1] == 5) {
|
||||||
self.idx += 2;
|
self.idx += 2;
|
||||||
return Attribute{
|
return Attribute{
|
||||||
.@"256_bg" = @truncate(slice[2]),
|
.@"256_bg" = @truncate(slice[2]),
|
||||||
@ -538,3 +538,9 @@ test "sgr: direct color fg missing color" {
|
|||||||
var p: Parser = .{ .params = &[_]u16{ 38, 5 }, .colon = false };
|
var p: Parser = .{ .params = &[_]u16{ 38, 5 }, .colon = false };
|
||||||
while (p.next()) |_| {}
|
while (p.next()) |_| {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "sgr: direct color bg missing color" {
|
||||||
|
// This used to crash
|
||||||
|
var p: Parser = .{ .params = &[_]u16{ 48, 5 }, .colon = false };
|
||||||
|
while (p.next()) |_| {}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user