termio: fixes to kitty color reporting

The kitty color report response is an OSC, not a CSI, so change `[` to
`]`. Colors which are unset should be reported with `{key}=`.
This commit is contained in:
Gregory Anders
2024-11-26 08:59:51 -06:00
parent 518f8b1048
commit 2cbc2833d1

View File

@ -1418,7 +1418,7 @@ pub const StreamHandler = struct {
var buf = std.ArrayList(u8).init(self.alloc); var buf = std.ArrayList(u8).init(self.alloc);
defer buf.deinit(); defer buf.deinit();
const writer = buf.writer(); const writer = buf.writer();
try writer.writeAll("\x1b[21"); try writer.writeAll("\x1b]21");
for (request.list.items) |item| { for (request.list.items) |item| {
switch (item) { switch (item) {
@ -1435,7 +1435,7 @@ pub const StreamHandler = struct {
}, },
}, },
} orelse { } orelse {
log.warn("no color configured for {}", .{key}); try writer.print(";{}=", .{key});
continue; continue;
}; };